Clean code.

This commit is contained in:
Lars Jung 2014-08-30 18:53:16 +02:00
parent ba10f70b12
commit 8951732f3c
42 changed files with 2547 additions and 2572 deletions

View file

@ -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();
});