智能照明系统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/02/0257413b67065b27f5133517b4c...

20 lines
470 B

var Emitter = require('./Emitter');
exports = Emitter.extend({
className: 'MediaQuery',
initialize: function(query) {
var _this = this;
this.callSuper(Emitter, 'initialize');
this._mql = window.matchMedia(query);
this._mql.addListener(function() {
_this.emit(_this.isMatch() ? 'match' : 'unmatch');
});
},
isMatch: function() {
return this._mql.matches;
}
});
module.exports = exports;