mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
removed backbone from VS solution,
renamed NzbDrone.Backbone to UI
This commit is contained in:
31
UI/HeaderView.js
Normal file
31
UI/HeaderView.js
Normal file
@@ -0,0 +1,31 @@
|
||||
define(['app'], function () {
|
||||
NzbDrone.HeaderView = Backbone.Marionette.ItemView.extend({
|
||||
events: {
|
||||
'click #logo': 'onClick'
|
||||
},
|
||||
|
||||
onClick: function (event) {
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
var target = $(event.target);
|
||||
var href = undefined;
|
||||
|
||||
//look down for <a/>
|
||||
href = event.target.getAttribute('href');
|
||||
|
||||
if (href && href.startsWith('http')) {
|
||||
window.location.href = href;
|
||||
} else {
|
||||
NzbDrone.Router.navigate(href, { trigger: true, replace: true });
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
initialize: function () {
|
||||
this.setElement($('#in-nav'));
|
||||
}
|
||||
});
|
||||
|
||||
return new NzbDrone.HeaderView();
|
||||
});
|
Reference in New Issue
Block a user