diff --git a/UI/Settings/Notifications/AddView.js b/UI/Settings/Notifications/AddView.js index eae3dd787..71968bad0 100644 --- a/UI/Settings/Notifications/AddView.js +++ b/UI/Settings/Notifications/AddView.js @@ -12,10 +12,10 @@ define([ className: 'btn', events: { - 'click': 'add' + 'click': 'addNotification' }, - add: function () { + addNotification: function () { this.model.set('id', undefined); var view = new NzbDrone.Settings.Notifications.EditView({ model: this.model}); NzbDrone.modalRegion.show(view); diff --git a/UI/Settings/Notifications/CollectionView.js b/UI/Settings/Notifications/CollectionView.js index c83b4c756..4b2b67d0f 100644 --- a/UI/Settings/Notifications/CollectionView.js +++ b/UI/Settings/Notifications/CollectionView.js @@ -6,14 +6,16 @@ define(['app', 'Settings/Notifications/ItemView', 'Settings/Notifications/AddVie template : 'Settings/Notifications/CollectionTemplate', events: { - 'click .x-add': function () { - var schema = new NzbDrone.Settings.Notifications.Collection(); - schema.url = '/api/notification/schema'; - schema.fetch(); + 'click .x-add': 'openSchemaModal' + }, - var view = new NzbDrone.Settings.Notifications.AddView({ collection: schema}); - NzbDrone.modalRegion.show(view); - } + openSchemaModal: function () { + var schema = new NzbDrone.Settings.Notifications.Collection(); + schema.url = '/api/notification/schema'; + schema.fetch(); + + var view = new NzbDrone.Settings.Notifications.AddView({ collection: schema}); + NzbDrone.modalRegion.show(view); } }); });