Files
cordova-plugin-screen-orien…/www/screenorientation.windows.js
T
tokotchd 7a11a3dd7e Added Windows 8.1 Support
Windows 8.1 has javascript calls, were not be complicated to add.
2015-08-07 12:12:10 -04:00

34 lines
912 B
JavaScript

var screenOrientation = {};
screenOrientation.lockOrientation = function (orientation) {
var orientationNumber;
switch (orientation) {
case 'landscape':
orientationNumber = 5;
break;
case 'portrait':
orientationNumber = 10;
break;
case 'landscape-primary':
orientationNumber = 1;
break;
case 'landscape-secondary':
orientationNumber = 4;
break;
case 'portrait-primary':
orientationNumber = 2;
break;
case 'portrait-secondary':
orientationNumber = 8;
break;
case 'unlocked':
orientationNumber = 0;
break;
default:
break;
}
Windows.Graphics.Display.DisplayInformation.autoRotationPreferences = orientationNumber;
};
module.exports = screenOrientation;