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

This commit is contained in:
Jesse MacFadyen
2017-03-10 17:59:50 -08:00
parent 9d6f2d271d
commit 837c17b479
2 changed files with 8 additions and 2 deletions
+4
View File
@@ -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);
+4 -2
View File
@@ -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);