cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From purplecabb...@apache.org
Subject [3/9] cordova-plugin-screen-orientation git commit: improved the orientation change method
Date Wed, 22 Feb 2017 03:26:46 GMT
improved the orientation change method


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-screen-orientation/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-screen-orientation/commit/f8c75e34
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-screen-orientation/tree/f8c75e34
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-screen-orientation/diff/f8c75e34

Branch: refs/heads/master
Commit: f8c75e341ae521cd248e9385e6b05bdd3344274d
Parents: 1f536ec
Author: maverickmishra <vishalmishra0907@gmail.com>
Authored: Mon Jan 9 17:10:07 2017 -0800
Committer: maverickmishra <vishalmishra0907@gmail.com>
Committed: Wed Jan 25 10:47:32 2017 -0800

----------------------------------------------------------------------
 www/screenorientation.js | 18 ++----------------
 1 file changed, 2 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-screen-orientation/blob/f8c75e34/www/screenorientation.js
----------------------------------------------------------------------
diff --git a/www/screenorientation.js b/www/screenorientation.js
index bf0f1e8..891c3bc 100644
--- a/www/screenorientation.js
+++ b/www/screenorientation.js
@@ -94,22 +94,8 @@
     orientationChange();
 
     function orientationChange() {
-        switch (window.orientation) {
-            case 0:
-                screen.orientation.type = window.OrientationType['0']; //append angle here
?
-                break;
-            case 90:
-                screen.orientation.type = window.OrientationType['90'];
-                break;
-            case 180:
-                screen.orientation.type = window.OrientationType['180'];
-                break;
-            case -90:
-                screen.orientation.type = window.OrientationType['-90'];
-                break;
-            default:
-                screen.orientation.type = window.OrientationType['0'];
-        }
+        screen.orientation.type = window.OrientationType[window.orientation];
+               
     }
     window.addEventListener("orientationchange", orientationChange, true);
     module.exports = screenOrientation;
\ No newline at end of file


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message