mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-19 21:13:28 -07:00
show a basic spinner while the app is loading all the js files/series list.
This commit is contained in:
parent
39f0ed9d21
commit
376b386b31
9 changed files with 159 additions and 143 deletions
41
UI/Navbar/NavbarView.js
Normal file
41
UI/Navbar/NavbarView.js
Normal file
|
@ -0,0 +1,41 @@
|
|||
'use strict';
|
||||
define(
|
||||
[
|
||||
'marionette'
|
||||
], function (Marionette) {
|
||||
return Marionette.ItemView.extend({
|
||||
events: {
|
||||
'click a': 'onClick'
|
||||
},
|
||||
|
||||
template : 'Navbar/NavbarTemplate',
|
||||
|
||||
onClick: function (event) {
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
var target = $(event.target);
|
||||
|
||||
//look down for <a/>
|
||||
var href = event.target.getAttribute('href');
|
||||
|
||||
//if couldn't find it look up
|
||||
if (!href && target.parent('a') && target.parent('a')[0]) {
|
||||
|
||||
var linkElement = target.parent('a')[0];
|
||||
|
||||
href = linkElement.getAttribute('href');
|
||||
this.setActive(linkElement);
|
||||
}
|
||||
else {
|
||||
this.setActive(event.target);
|
||||
}
|
||||
},
|
||||
|
||||
setActive: function (element) {
|
||||
//Todo: Set active on first load
|
||||
this.$('a').removeClass('active');
|
||||
$(element).addClass('active');
|
||||
}
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue