mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-25 20:44:53 -04:00
Improves event system.
This commit is contained in:
parent
34eed09537
commit
2819fd8496
9 changed files with 75 additions and 50 deletions
|
@ -61,6 +61,11 @@ modulejs.define('ext/thumbnails', ['_', 'core/settings', 'core/event', 'core/ser
|
|||
}, settings.delay);
|
||||
},
|
||||
|
||||
onLocationRefreshed = function (item, added, removed) {
|
||||
|
||||
_.each(added, checkEntry);
|
||||
},
|
||||
|
||||
init = function () {
|
||||
|
||||
if (!settings.enabled || !server.api) {
|
||||
|
@ -68,10 +73,7 @@ modulejs.define('ext/thumbnails', ['_', 'core/settings', 'core/event', 'core/ser
|
|||
}
|
||||
|
||||
event.sub('location.changed', onLocationChanged);
|
||||
event.sub('entry.created', function (entry) {
|
||||
|
||||
checkEntry(entry);
|
||||
});
|
||||
event.sub('location.refreshed', onLocationRefreshed);
|
||||
};
|
||||
|
||||
init();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue