From 0725dcee7372286ce3b4bed76e643671dbb12680 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Wed, 29 May 2013 00:20:41 -0700 Subject: [PATCH] Fixed up notifications edit --- UI/Settings/Notifications/EditTemplate.html | 10 ++++++++-- UI/Settings/Notifications/EditView.js | 13 ++++++++++--- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/UI/Settings/Notifications/EditTemplate.html b/UI/Settings/Notifications/EditTemplate.html index 477acf207..f4ab178be 100644 --- a/UI/Settings/Notifications/EditTemplate.html +++ b/UI/Settings/Notifications/EditTemplate.html @@ -1,6 +1,10 @@  \ No newline at end of file diff --git a/UI/Settings/Notifications/EditView.js b/UI/Settings/Notifications/EditView.js index 6f731bf9a..559429a2d 100644 --- a/UI/Settings/Notifications/EditView.js +++ b/UI/Settings/Notifications/EditView.js @@ -2,7 +2,8 @@ define([ 'app', - 'Settings/Notifications/Model' + 'Settings/Notifications/Model', + 'Settings/Notifications/DeleteView' ], function () { @@ -10,14 +11,15 @@ define([ template : 'Settings/Notifications/EditTemplate', events: { - 'click .x-save': 'save' + 'click .x-save': '_saveNotification', + 'click .x-remove': '_deleteNotification' }, initialize: function (options) { this.notificationCollection = options.notificationCollection; }, - save: function () { + _saveNotification: function () { var name = this.model.get('name'); var success = 'Notification Saved: ' + name; var fail = 'Failed to save notification: ' + name; @@ -25,6 +27,11 @@ define([ this.model.save(undefined, this.syncNotification(success, fail, this)); }, + _deleteNotification: function () { + var view = new NzbDrone.Settings.Notifications.DeleteView({ model: this.model }); + NzbDrone.modalRegion.show(view); + }, + syncNotification: function (success, error, context) { return { success: function () {