2013-05-23 07:12:01 +02:00
|
|
|
|
'use strict';
|
2013-06-19 03:02:23 +02:00
|
|
|
|
define(['app', 'Mixins/AsModelBoundView'], function (App, AsModelBoundView) {
|
2013-05-23 07:12:01 +02:00
|
|
|
|
|
2013-06-19 03:02:23 +02:00
|
|
|
|
var view = Backbone.Marionette.ItemView.extend({
|
2013-05-23 07:12:01 +02:00
|
|
|
|
template: 'Settings/General/GeneralTemplate',
|
|
|
|
|
|
|
|
|
|
initialize: function () {
|
|
|
|
|
NzbDrone.vent.on(NzbDrone.Commands.SaveSettings, this.saveSettings, this);
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
saveSettings: function () {
|
|
|
|
|
if (!this.model.isSaved) {
|
2013-06-01 02:22:47 +02:00
|
|
|
|
this.model.save(undefined, NzbDrone.Settings.SyncNotificaiton.callback({
|
|
|
|
|
successMessage: 'General Settings saved',
|
2013-06-19 03:02:23 +02:00
|
|
|
|
errorMessage : "Failed to save General Settings"
|
2013-06-01 02:22:47 +02:00
|
|
|
|
}));
|
2013-05-23 07:12:01 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
);
|
2013-06-19 03:02:23 +02:00
|
|
|
|
|
|
|
|
|
return AsModelBoundView.call(view);
|
2013-05-23 07:12:01 +02:00
|
|
|
|
});
|
|
|
|
|
|