2013-03-04 00:09:43 +00:00
|
|
|
|
'use strict';
|
2013-06-13 23:19:24 +00:00
|
|
|
|
define(['app',
|
2013-06-19 01:02:23 +00:00
|
|
|
|
'marionette',
|
|
|
|
|
'Settings/Naming/NamingModel',
|
|
|
|
|
'Settings/SyncNotification',
|
|
|
|
|
'Mixins/AsModelBoundView'], function (App, Marionette, NamingModel, SyncNotification, AsModelBoundView) {
|
2013-03-04 00:09:43 +00:00
|
|
|
|
|
2013-06-19 01:02:23 +00:00
|
|
|
|
var view = Marionette.ItemView.extend({
|
|
|
|
|
template: 'Settings/Naming/NamingTemplate',
|
2013-03-04 00:09:43 +00:00
|
|
|
|
|
2013-03-29 23:28:58 +00:00
|
|
|
|
initialize: function () {
|
2013-06-19 01:02:23 +00:00
|
|
|
|
this.model = new NamingModel();
|
2013-04-25 04:27:49 +00:00
|
|
|
|
this.model.fetch();
|
|
|
|
|
|
2013-06-19 01:02:23 +00:00
|
|
|
|
this.listenTo(App.vent, App.Commands.SaveSettings, this.saveSettings);
|
|
|
|
|
|
2013-03-07 08:01:18 +00:00
|
|
|
|
},
|
|
|
|
|
|
2013-04-25 04:27:49 +00:00
|
|
|
|
saveSettings: function () {
|
2013-06-19 01:02:23 +00:00
|
|
|
|
this.model.saveIfChanged(undefined, SyncNotification.callback({
|
2013-06-01 00:22:47 +00:00
|
|
|
|
successMessage: 'Naming Settings saved',
|
2013-06-19 01:02:23 +00:00
|
|
|
|
errorMessage : "Failed to save Naming Settings"
|
2013-06-01 00:22:47 +00:00
|
|
|
|
}));
|
2013-03-04 00:09:43 +00:00
|
|
|
|
}
|
|
|
|
|
});
|
2013-06-19 01:02:23 +00:00
|
|
|
|
|
|
|
|
|
return AsModelBoundView.call(view);
|
|
|
|
|
});
|