From 665a26a2e903bf1919e42d14dab77d28f3c9d2cb Mon Sep 17 00:00:00 2001 From: Zach Wise Date: Mon, 30 Apr 2012 09:55:21 -0500 Subject: [PATCH] Added orientation --- source/js/VMM.Browser.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/source/js/VMM.Browser.js b/source/js/VMM.Browser.js index 6791fbc..b08a895 100644 --- a/source/js/VMM.Browser.js +++ b/source/js/VMM.Browser.js @@ -10,7 +10,16 @@ if(typeof VMM != 'undefined' && typeof VMM.Browser == 'undefined') { || "an unknown version"; this.OS = this.searchString(this.dataOS) || "an unknown OS"; this.device = this.searchDevice(navigator.userAgent); - + this.orientation = this.searchOrientation(window.orientation); + }, + searchOrientation: function(orientation) { + if ( orientation == 0 || orientation == 180) { + return "portrait"; + } else if ( orientation == 90 || orientation == -90) { + return "landscape"; + } else { + return "normal"; + } }, searchDevice: function(d) { if (d.match(/Android/i) || d.match(/iPhone|iPod/i)) {