mirror of
https://github.com/Radarr/Radarr.git
synced 2024-11-09 12:32:31 +01:00
35 lines
880 B
JavaScript
35 lines
880 B
JavaScript
'use strict';
|
|
define(['app',
|
|
'backbone.deepmodel',
|
|
'Mixins/AsChangeTrackingModel',
|
|
'Shared/Messenger'], function (App, DeepModel, AsChangeTrackingModel, Messenger) {
|
|
var model = DeepModel.DeepModel.extend({
|
|
|
|
initialize: function () {
|
|
this.listenTo(App.vent, App.Commands.SaveSettings, this.saveSettings);
|
|
},
|
|
|
|
saveSettings: function () {
|
|
|
|
if (!this.isSaved) {
|
|
|
|
var savePromise = this.save();
|
|
|
|
Messenger.monitor(
|
|
{
|
|
promise : savePromise,
|
|
successMessage: this.successMessage,
|
|
errorMessage : this.errorMessage
|
|
});
|
|
|
|
return savePromise;
|
|
}
|
|
|
|
return undefined;
|
|
}
|
|
|
|
});
|
|
|
|
return AsChangeTrackingModel.call(model);
|
|
});
|