mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-14 00:53:57 -07:00
New: show indicator when testing indexers, connections and download clients
This commit is contained in:
parent
1ed45625df
commit
d9445eab84
8 changed files with 84 additions and 16 deletions
|
@ -19,7 +19,8 @@ define([
|
|||
|
||||
ui: {
|
||||
path : '.x-path',
|
||||
modalBody : '.modal-body'
|
||||
modalBody : '.modal-body',
|
||||
indicator : '.x-indicator'
|
||||
},
|
||||
|
||||
events: {
|
||||
|
@ -44,6 +45,8 @@ define([
|
|||
},
|
||||
|
||||
_save: function () {
|
||||
this.ui.indicator.show();
|
||||
|
||||
var self = this;
|
||||
var promise = this.model.save();
|
||||
|
||||
|
@ -52,10 +55,16 @@ define([
|
|||
self.targetCollection.add(self.model, { merge: true });
|
||||
vent.trigger(vent.Commands.CloseModalCommand);
|
||||
});
|
||||
|
||||
promise.fail(function () {
|
||||
self.ui.indicator.hide();
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
_saveAndAdd: function () {
|
||||
this.ui.indicator.show();
|
||||
|
||||
var self = this;
|
||||
var promise = this.model.save();
|
||||
|
||||
|
@ -65,6 +74,10 @@ define([
|
|||
|
||||
require('Settings/DownloadClient/Add/DownloadClientSchemaModal').open(self.targetCollection);
|
||||
});
|
||||
|
||||
promise.fail(function () {
|
||||
self.ui.indicator.hide();
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -78,7 +91,13 @@ define([
|
|||
},
|
||||
|
||||
_test: function () {
|
||||
this.model.test();
|
||||
var self = this;
|
||||
|
||||
this.ui.indicator.show();
|
||||
|
||||
this.model.test().always(function () {
|
||||
self.ui.indicator.hide();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue