mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-25 12:34:47 -04:00
Improves event system.
This commit is contained in:
parent
aded72363a
commit
34eed09537
13 changed files with 98 additions and 130 deletions
|
@ -14,7 +14,6 @@ modulejs.define('ext/crumb', ['_', '$', 'core/settings', 'core/resource', 'core/
|
|||
pageHintTemplate = '<img class="hint" src="' + resource.image('page') + '" alt="has index page"/>',
|
||||
statusHintTemplate = '<span class="hint"/>',
|
||||
|
||||
// updates the crumb for this single entry
|
||||
update = function (entry, force) {
|
||||
|
||||
if (!force && entry.$crumb && entry.$crumb.data('status') === entry.status) {
|
||||
|
@ -62,13 +61,6 @@ modulejs.define('ext/crumb', ['_', '$', 'core/settings', 'core/resource', 'core/
|
|||
return $html;
|
||||
},
|
||||
|
||||
onContentChanged = function (entry) {
|
||||
|
||||
if (entry.$crumb) {
|
||||
update(entry, true);
|
||||
}
|
||||
},
|
||||
|
||||
onLocationChanged = function (item) {
|
||||
|
||||
var crumb = item.getCrumb(),
|
||||
|
@ -101,10 +93,6 @@ modulejs.define('ext/crumb', ['_', '$', 'core/settings', 'core/resource', 'core/
|
|||
return;
|
||||
}
|
||||
|
||||
// event.sub('entry.created', onContentChanged);
|
||||
// event.sub('entry.removed', onContentChanged);
|
||||
event.sub('entry.changed', onContentChanged);
|
||||
|
||||
event.sub('location.changed', onLocationChanged);
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue