初始化提交

This commit is contained in:
王立帮
2024-07-19 10:16:00 +08:00
parent 4c7b571f20
commit 4a2d56dcc4
7084 changed files with 741212 additions and 63 deletions

View File

@@ -0,0 +1,44 @@
goog.loadJs('common', () => {
goog.require('ifvisible');
goog.require('Mixly.Events');
goog.provide('Mixly.IfVisible');
const { Events, IfVisible } = Mixly;
IfVisible.events = new Events(['blur', 'focus', 'idle', 'wakeup']);
IfVisible.init = function () {
ifvisible.on('blur', () => this.runEvent('blur'));
ifvisible.on('focus', () => this.runEvent('focus'));
ifvisible.on('idle', () => this.runEvent('idle'));
ifvisible.on('wakeup', () => this.runEvent('wakeup'));
}
IfVisible.bind = function (type, func) {
return this.events.bind(type, func);
}
IfVisible.unbind = function (id) {
this.events.unbind(id);
}
IfVisible.addEventsType = function (eventsType) {
this.events.addType(eventsType);
}
IfVisible.runEvent = function (eventsType, ...args) {
return this.events.run(eventsType, ...args);
}
IfVisible.offEvent = function (eventsType) {
this.events.off(eventsType);
}
IfVisible.resetEvent = function () {
this.events.reset();
}
IfVisible.init();
});