mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-25 20:44:53 -04:00
Clean code.
This commit is contained in:
parent
ba10f70b12
commit
8951732f3c
42 changed files with 2547 additions and 2572 deletions
|
@ -1,30 +1,29 @@
|
|||
|
||||
modulejs.define('ext/title', ['_', 'core/settings', 'core/event'], function (_, allsettings, event) {
|
||||
|
||||
var settings = _.extend({
|
||||
enabled: false
|
||||
}, allsettings.title),
|
||||
}, allsettings.title);
|
||||
|
||||
onLocationChanged = function (item) {
|
||||
function onLocationChanged(item) {
|
||||
|
||||
var labels = _.pluck(item.getCrumb(), 'label'),
|
||||
title = labels.join(' > ');
|
||||
var labels = _.pluck(item.getCrumb(), 'label'),
|
||||
title = labels.join(' > ');
|
||||
|
||||
if (labels.length > 1) {
|
||||
title = labels[labels.length - 1] + ' - ' + title;
|
||||
}
|
||||
if (labels.length > 1) {
|
||||
title = labels[labels.length - 1] + ' - ' + title;
|
||||
}
|
||||
|
||||
document.title = title;
|
||||
},
|
||||
document.title = title;
|
||||
}
|
||||
|
||||
init = function () {
|
||||
function init() {
|
||||
|
||||
if (!settings.enabled) {
|
||||
return;
|
||||
}
|
||||
if (!settings.enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
event.sub('location.changed', onLocationChanged);
|
||||
};
|
||||
event.sub('location.changed', onLocationChanged);
|
||||
}
|
||||
|
||||
init();
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue