improved the orientation change method

This commit is contained in:
maverickmishra 2017-01-09 17:10:07 -08:00
parent 1f536ec80e
commit f8c75e341a

View File

@ -94,22 +94,8 @@
orientationChange(); orientationChange();
function orientationChange() { function orientationChange() {
switch (window.orientation) { screen.orientation.type = window.OrientationType[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'];
}
} }
window.addEventListener("orientationchange", orientationChange, true); window.addEventListener("orientationchange", orientationChange, true);
module.exports = screenOrientation; module.exports = screenOrientation;