1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-22 22:15:17 -04:00

UI Cleanup - Updated Navbar, Profile, Quality and Release subtrees.

This commit is contained in:
Taloth Saldono
2015-02-13 22:47:42 +01:00
parent 29d9e3dadf
commit 860f55996c
10 changed files with 217 additions and 146 deletions
+28 -11
View File
@@ -5,38 +5,55 @@ var QueueView = require('../Activity/Queue/QueueView');
require('./Search');
module.exports = Marionette.Layout.extend({
template : 'Navbar/NavbarLayoutTemplate',
regions : {
template : 'Navbar/NavbarLayoutTemplate',
regions : {
health : '#x-health',
queue : '#x-queue-count'
},
ui : {
ui : {
search : '.x-series-search',
collapse : '.x-navbar-collapse'
},
events : {"click a" : 'onClick'},
onRender : function(){
events : {
'click a' : 'onClick'
},
onRender : function() {
this.ui.search.bindSearch();
this.health.show(new HealthView());
this.queue.show(new QueueView());
},
onClick : function(event){
onClick : function(event) {
event.preventDefault();
var target = $(event.target);
//look down for <a/>
var href = event.target.getAttribute('href');
if(!href && target.closest('a') && target.closest('a')[0]) {
//if couldn't find it look up'
if (!href && target.closest('a') && target.closest('a')[0]) {
var linkElement = target.closest('a')[0];
href = linkElement.getAttribute('href');
this.setActive(linkElement);
}
else {
} else {
this.setActive(event.target);
}
if($(window).width() < 768) {
if ($(window).width() < 768) {
this.ui.collapse.collapse('hide');
}
},
setActive : function(element){
setActive : function(element) {
//Todo: Set active on first load
this.$('a').removeClass('active');
$(element).addClass('active');
}