You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by to...@apache.org on 2016/05/23 13:42:29 UTC

[31/50] cordova-plugin-screen-orientation git commit: Removed direct reference to screen in addScreenOrientationApi function

Removed direct reference to screen in addScreenOrientationApi function


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/c8b89002
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-screen-orientation/tree/c8b89002
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-screen-orientation/diff/c8b89002

Branch: refs/heads/master
Commit: c8b89002f904a03cbf7bbd7a9b743ff8bfa8c921
Parents: 1195b40
Author: Grant Benvenuti <g....@pni.com.au>
Authored: Mon Aug 10 09:37:38 2015 +1000
Committer: Grant Benvenuti <g....@pni.com.au>
Committed: Mon Aug 10 09:37:38 2015 +1000

----------------------------------------------------------------------
 www/screenorientation.js | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-screen-orientation/blob/c8b89002/www/screenorientation.js
----------------------------------------------------------------------
diff --git a/www/screenorientation.js b/www/screenorientation.js
index 64c682b..245cd63 100644
--- a/www/screenorientation.js
+++ b/www/screenorientation.js
@@ -45,24 +45,22 @@ screenOrientation.setOrientation = function(orientation) {
     console.log('setOrientation not supported on device');
 };
 
-function addScreenOrientationApi(obj) {
-    if (obj.unlockOrientation || obj.lockOrientation) {
+function addScreenOrientationApi(screenObject) {
+    if (screenObject.unlockOrientation || screenObject.lockOrientation) {
         return;
     }
 
-    obj.lockOrientation = function(orientation) {
+    screenObject.lockOrientation = function(orientation) {
         if (Orientations.indexOf(orientation) == -1) {
             console.log('INVALID ORIENTATION', orientation);
             return;
         }
-        screenOrientation.currOrientation = orientation;
-        screen.orientation = screenOrientation.currOrientation;
+        screenOrientation.currOrientation = screenObject.orientation = orientation;
         screenOrientation.setOrientation(orientation);
     };
 
-    obj.unlockOrientation = function() {
-        screenOrientation.currOrientation = 'unlocked';
-        screen.orientation = screenOrientation.currOrientation;
+    screenObject.unlockOrientation = function() {
+        screenOrientation.currOrientation = screenObject.orientation = 'unlocked';
         screenOrientation.setOrientation('unlocked');
     };
 }


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