mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 13:33:34 -07:00
Validate newznab indexers when adding
This commit is contained in:
parent
34b5a833f5
commit
f0e721ee80
8 changed files with 87 additions and 6 deletions
|
@ -39,6 +39,9 @@
|
|||
{{#if id}}
|
||||
<button class="btn btn-danger pull-left x-remove">delete</button>
|
||||
{{/if}}
|
||||
|
||||
<span class="x-activity"></span>
|
||||
|
||||
<button class="btn" data-dismiss="modal">cancel</button>
|
||||
|
||||
<div class="btn-group">
|
||||
|
|
|
@ -11,6 +11,10 @@ define(
|
|||
var view = Marionette.ItemView.extend({
|
||||
template: 'Settings/Indexers/EditTemplate',
|
||||
|
||||
ui : {
|
||||
activity: '.x-activity'
|
||||
},
|
||||
|
||||
events: {
|
||||
'click .x-save' : '_save',
|
||||
'click .x-save-and-add': '_saveAndAdd'
|
||||
|
@ -21,6 +25,8 @@ define(
|
|||
},
|
||||
|
||||
_save: function () {
|
||||
this.ui.activity.html('<i class="icon-nd-spinner"></i>');
|
||||
|
||||
var self = this;
|
||||
var promise = this.model.saveSettings();
|
||||
|
||||
|
@ -29,10 +35,16 @@ define(
|
|||
self.indexerCollection.add(self.model, { merge: true });
|
||||
App.vent.trigger(App.Commands.CloseModalCommand);
|
||||
});
|
||||
|
||||
promise.always(function () {
|
||||
self.ui.activity.empty();
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
_saveAndAdd: function () {
|
||||
this.ui.activity.html('<i class="icon-nd-spinner"></i>');
|
||||
|
||||
var self = this;
|
||||
var promise = this.model.saveSettings();
|
||||
|
||||
|
@ -50,6 +62,10 @@ define(
|
|||
self.model.set('fields.' + key + '.value', '');
|
||||
});
|
||||
});
|
||||
|
||||
promise.always(function () {
|
||||
self.ui.activity.empty();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue