智能照明系统APP-本地串口
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
LightingSystemApp-serial/.svn/pristine/dc/dca9fab59ebc11a6b7a0316aeae...

28 lines
656 B

var Emitter = require('./Emitter');
var safeGet = require('./safeGet');
var screen = window.screen;
exports = {
get: function() {
if (screen) {
var orientation = safeGet(screen, 'orientation.type');
if (orientation) return orientation.split('-').shift();
}
return window.innerWidth > window.innerHeight
? 'landscape'
: 'portrait';
}
};
Emitter.mixin(exports);
window.addEventListener(
'orientationchange',
function() {
setTimeout(function() {
exports.emit('change', exports.get());
}, 200);
},
false
);
module.exports = exports;