cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From purplecabb...@apache.org
Subject cordova-plugin-screen-orientation git commit: [windows] Fix failing tests, added Promise if it is not defined 8.1
Date Sat, 11 Mar 2017 05:15:03 GMT
Repository: cordova-plugin-screen-orientation
Updated Branches:
  refs/heads/master 9d6f2d271 -> 837c17b47


[windows] Fix failing tests, added Promise if it is not defined 8.1


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

Branch: refs/heads/master
Commit: 837c17b4797ed134c3a699be2c5be552d1f61ec6
Parents: 9d6f2d2
Author: Jesse MacFadyen <purplecabbage@gmail.com>
Authored: Fri Mar 10 17:59:50 2017 -0800
Committer: Jesse MacFadyen <purplecabbage@gmail.com>
Committed: Fri Mar 10 17:59:50 2017 -0800

----------------------------------------------------------------------
 src/windows/CDVOrientationProxy.js | 4 ++++
 www/screenorientation.js           | 6 ++++--
 2 files changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-screen-orientation/blob/837c17b4/src/windows/CDVOrientationProxy.js
----------------------------------------------------------------------
diff --git a/src/windows/CDVOrientationProxy.js b/src/windows/CDVOrientationProxy.js
index ea28811..214994a 100644
--- a/src/windows/CDVOrientationProxy.js
+++ b/src/windows/CDVOrientationProxy.js
@@ -22,6 +22,10 @@
 var DisplayInfo = Windows.Graphics.Display.DisplayInformation;
 var Orientations = Windows.Graphics.Display.DisplayOrientations;
 
+if (!window.Promise) {
+    window.Promise = WinJS.Promise;
+}
+
 module.exports = {
     screenOrientation: function (win, fail, args) {
         //console.log("screenOrientation proxy called with " + args);

http://git-wip-us.apache.org/repos/asf/cordova-plugin-screen-orientation/blob/837c17b4/www/screenorientation.js
----------------------------------------------------------------------
diff --git a/www/screenorientation.js b/www/screenorientation.js
index 022e0ba..0bdb814 100644
--- a/www/screenorientation.js
+++ b/www/screenorientation.js
@@ -98,7 +98,6 @@ var onChangeListener = null;
 
 Object.defineProperty(screen.orientation, 'onchange', {
     set: function(listener) {
-        console.log("setting onchange to : " + listener);
 
         if (onChangeListener != null) {
             screen.orientation.removeEventListener('change', onChangeListener);
@@ -144,8 +143,11 @@ function setOrientationProperties() {
         case -90:
             screen.orientation.type = 'landscape-secondary';
             break;
+        default:
+            screen.orientation.type = 'portrait-primary';
+            break;
     }
-    screen.orientation.angle = window.orientation;
+    screen.orientation.angle = window.orientation || 0;
 
 }
 window.addEventListener("orientationchange", orientationchange, true);


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


Mime
View raw message