mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-28 21:12:43 +02:00
fixed saving settings. now done more generically.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user