1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-22 22:15:17 -04:00
Files
Radarr/src/UI/Shared/NzbDroneController.js
T
2014-09-01 21:55:01 -07:00

47 lines
1.2 KiB
JavaScript

'use strict';
define(
[
'vent',
'AppLayout',
'marionette',
'Shared/NotFoundView'
], function (vent, AppLayout, Marionette, NotFoundView) {
return Marionette.AppRouter.extend({
initialize: function () {
this.listenTo(vent, vent.Events.ServerUpdated, this._onServerUpdated);
},
showNotFound: function () {
this.setTitle('Not Found');
this.showMainRegion(new NotFoundView(this));
},
setTitle: function (title) {
title = title.toLocaleLowerCase();
if (title === 'nzbdrone') {
document.title = 'nzbdrone';
}
else {
document.title = title + ' - nzbdrone';
}
},
_onServerUpdated: function () {
this.pendingUpdate = true;
},
showMainRegion: function (view) {
if (this.pendingUpdate) {
window.location.reload();
}
else {
//AppLayout
AppLayout.mainRegion.show(view);
}
}
});
});