1
0
Fork 0
mirror of https://github.com/lidarr/Lidarr synced 2024-12-27 10:07:10 +00:00
Lidarr/UI/Settings/Naming/NamingView.js
kay.one 4da6654440 Added Auth, startup options to UI
Added caching to ConfigFileProvider,
2013-05-22 22:12:15 -07:00

41 lines
1.1 KiB
JavaScript

'use strict';
define(['app', 'Settings/Naming/NamingModel'], function () {
NzbDrone.Settings.Naming.NamingView = Backbone.Marionette.ItemView.extend({
template : 'Settings/Naming/NamingTemplate',
ui: {
tooltip: '[class^="help-inline"] i'
},
initialize: function () {
this.model = new NzbDrone.Settings.Naming.NamingModel();
this.model.fetch();
NzbDrone.vent.on(NzbDrone.Commands.SaveSettings, this.saveSettings, this);
},
onRender: function () {
//TODO: Move this to a mixin
this.ui.tooltip.tooltip({ placement: 'right' });
},
saveSettings: function () {
this.model.save(undefined, this.syncNotification("Naming Settings Saved", "Couldn't Save Naming Settings"));
},
syncNotification: function (success, error) {
return {
success: function () {
window.alert(success);
},
error: function () {
window.alert(error);
}
};
}
});
})
;