mirror of
https://github.com/lidarr/Lidarr
synced 2025-01-01 12:34:40 +00:00
Spinner on add series buttons
This commit is contained in:
parent
66a9cddf01
commit
e6566b26d8
1 changed files with 25 additions and 12 deletions
|
@ -32,14 +32,15 @@ define(
|
||||||
template: 'AddSeries/SearchResultViewTemplate',
|
template: 'AddSeries/SearchResultViewTemplate',
|
||||||
|
|
||||||
ui: {
|
ui: {
|
||||||
profile : '.x-profile',
|
profile : '.x-profile',
|
||||||
rootFolder : '.x-root-folder',
|
rootFolder : '.x-root-folder',
|
||||||
seasonFolder : '.x-season-folder',
|
seasonFolder : '.x-season-folder',
|
||||||
seriesType : '.x-series-type',
|
seriesType : '.x-series-type',
|
||||||
monitor : '.x-monitor',
|
monitor : '.x-monitor',
|
||||||
monitorTooltip : '.x-monitor-tooltip',
|
monitorTooltip : '.x-monitor-tooltip',
|
||||||
addButton : '.x-add',
|
addButton : '.x-add',
|
||||||
overview : '.x-overview'
|
addSearchButton : '.x-add-search',
|
||||||
|
overview : '.x-overview'
|
||||||
},
|
},
|
||||||
|
|
||||||
events: {
|
events: {
|
||||||
|
@ -184,8 +185,8 @@ define(
|
||||||
},
|
},
|
||||||
|
|
||||||
_addSeries: function (searchForMissingEpisodes) {
|
_addSeries: function (searchForMissingEpisodes) {
|
||||||
var icon = this.ui.addButton.find('icon');
|
this.ui.addButton.addClass('disabled');
|
||||||
icon.removeClass('icon-plus').addClass('icon-spin icon-spinner disabled');
|
this.ui.addSearchButton.addClass('disabled');
|
||||||
|
|
||||||
var profile = this.ui.profile.val();
|
var profile = this.ui.profile.val();
|
||||||
var rootFolderPath = this.ui.rootFolder.children(':selected').text();
|
var rootFolderPath = this.ui.rootFolder.children(':selected').text();
|
||||||
|
@ -206,12 +207,24 @@ define(
|
||||||
var self = this;
|
var self = this;
|
||||||
var promise = this.model.save();
|
var promise = this.model.save();
|
||||||
|
|
||||||
|
if (searchForMissingEpisodes) {
|
||||||
|
this.ui.addSearchButton.spinForPromise(promise);
|
||||||
|
}
|
||||||
|
|
||||||
|
else {
|
||||||
|
this.ui.addButton.spinForPromise(promise);
|
||||||
|
}
|
||||||
|
|
||||||
|
promise.always(function () {
|
||||||
|
self.ui.addButton.removeClass('disabled');
|
||||||
|
self.ui.addSearchButton.removeClass('disabled');
|
||||||
|
});
|
||||||
|
|
||||||
promise.done(function () {
|
promise.done(function () {
|
||||||
SeriesCollection.add(self.model);
|
SeriesCollection.add(self.model);
|
||||||
|
|
||||||
self.close();
|
self.close();
|
||||||
icon.removeClass('icon-spin icon-spinner disabled').addClass('icon-search');
|
|
||||||
|
|
||||||
Messenger.show({
|
Messenger.show({
|
||||||
message: 'Added: ' + self.model.get('title'),
|
message: 'Added: ' + self.model.get('title'),
|
||||||
actions : {
|
actions : {
|
||||||
|
|
Loading…
Reference in a new issue