Improves event system.

This commit is contained in:
Lars Jung 2012-10-26 00:30:52 +02:00
parent 34eed09537
commit 2819fd8496
9 changed files with 75 additions and 50 deletions

View file

@ -224,6 +224,11 @@ modulejs.define('ext/preview-img', ['_', '$', 'core/settings', 'core/resource',
_.each(item.content, initEntry);
},
onLocationRefreshed = function (item, added, removed) {
_.each(added, initEntry);
},
init = function () {
if (!settings.enabled) {
@ -280,7 +285,7 @@ modulejs.define('ext/preview-img', ['_', '$', 'core/settings', 'core/resource',
});
event.sub('location.changed', onLocationChanged);
event.sub('entry.created', initEntry);
event.sub('location.refreshed', onLocationRefreshed);
$(window).on('resize load', adjustSize);
};