1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-23 22:25:14 -04:00

UI Cleanup - Updated Activity subtree.

This commit is contained in:
Taloth Saldono
2015-02-13 22:03:50 +01:00
parent b308f06af3
commit b556eda4a0
25 changed files with 659 additions and 510 deletions
+29 -17
View File
@@ -6,28 +6,33 @@ var BlacklistLayout = require('./Blacklist/BlacklistLayout');
var QueueLayout = require('./Queue/QueueLayout');
module.exports = Marionette.Layout.extend({
template : 'Activity/ActivityLayoutTemplate',
regions : {
template : 'Activity/ActivityLayoutTemplate',
regions : {
queueRegion : '#queue',
history : '#history',
blacklist : '#blacklist'
},
ui : {
ui : {
queueTab : '.x-queue-tab',
historyTab : '.x-history-tab',
blacklistTab : '.x-blacklist-tab'
},
events : {
"click .x-queue-tab" : '_showQueue',
"click .x-history-tab" : '_showHistory',
"click .x-blacklist-tab" : '_showBlacklist'
events : {
'click .x-queue-tab' : '_showQueue',
'click .x-history-tab' : '_showHistory',
'click .x-blacklist-tab' : '_showBlacklist'
},
initialize : function(options){
if(options.action) {
initialize : function(options) {
if (options.action) {
this.action = options.action.toLowerCase();
}
},
onShow : function(){
onShow : function() {
switch (this.action) {
case 'history':
this._showHistory();
@@ -39,32 +44,39 @@ module.exports = Marionette.Layout.extend({
this._showQueue();
}
},
_navigate : function(route){
_navigate : function(route) {
Backbone.history.navigate(route, {
trigger : false,
replace : true
});
},
_showHistory : function(e){
if(e) {
_showHistory : function(e) {
if (e) {
e.preventDefault();
}
this.history.show(new HistoryLayout());
this.ui.historyTab.tab('show');
this._navigate('/activity/history');
},
_showBlacklist : function(e){
if(e) {
_showBlacklist : function(e) {
if (e) {
e.preventDefault();
}
this.blacklist.show(new BlacklistLayout());
this.ui.blacklistTab.tab('show');
this._navigate('/activity/blacklist');
},
_showQueue : function(e){
if(e) {
_showQueue : function(e) {
if (e) {
e.preventDefault();
}
this.queueRegion.show(new QueueLayout());
this.ui.queueTab.tab('show');
this._navigate('/activity/queue');