mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 02:37:08 -07:00
fixed saving settings. now done more generically.
This commit is contained in:
parent
d126c6efc1
commit
806e58ed1f
13 changed files with 104 additions and 161 deletions
|
@ -12,7 +12,8 @@ define(function () {
|
|||
case 'info':
|
||||
options.hideAfter = 5;
|
||||
break;
|
||||
case 'error':
|
||||
|
||||
default :
|
||||
options.hideAfter = 0;
|
||||
}
|
||||
}
|
||||
|
@ -23,5 +24,35 @@ define(function () {
|
|||
showCloseButton: true,
|
||||
hideAfter : options.hideAfter
|
||||
});
|
||||
}};
|
||||
},
|
||||
|
||||
|
||||
monitor: function (options) {
|
||||
|
||||
if (!options.promise) {
|
||||
throw 'promise is required';
|
||||
}
|
||||
|
||||
if (!options.successMessage) {
|
||||
throw 'success message is required';
|
||||
}
|
||||
|
||||
if (!options.errorMessage) {
|
||||
throw 'error message is required';
|
||||
}
|
||||
|
||||
var self = this;
|
||||
|
||||
options.promise.done(function () {
|
||||
self.show({message: options.successMessage});
|
||||
});
|
||||
|
||||
options.promise.fail(function () {
|
||||
self.show({message: options.errorMessage, type: 'error'});
|
||||
});
|
||||
|
||||
return options.promise;
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue