Sonarr/UI/Settings/SyncNotification.js

28 lines
881 B
JavaScript
Raw Normal View History

2013-06-01 00:22:47 +00:00
"use strict";
2013-06-19 01:02:23 +00:00
define(['shared/messenger'], function (Messenger) {
return {
callback: function (options) {
return {
success: function () {
if (options.successMessage) {
Messenger.show({message: options.successMessage});
}
2013-06-01 00:22:47 +00:00
2013-06-19 01:02:23 +00:00
if (options.successCallback) {
options.successCallback.call(options.context);
}
},
error : function () {
if (options.errorMessage) {
Messenger.show({message: options.errorMessage, type: 'error'});
2013-06-01 00:22:47 +00:00
}
2013-06-19 01:02:23 +00:00
if (options.errorCallback) {
options.errorCallback.call(options.context);
}
}
};
}
};
});