New: show indicator when testing indexers, connections and download clients

This commit is contained in:
Mark McDowall 2014-08-02 20:05:21 -07:00
parent 1ed45625df
commit d9445eab84
8 changed files with 84 additions and 16 deletions

View file

@ -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();
});
}
});