From c039aedbb92bb51587416dfe375aae182444fa6f Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Wed, 22 May 2013 20:37:43 -0700 Subject: [PATCH] Using messenger for notifications on series add --- UI/AddSeries/Existing/ImportSeriesView.js | 14 +++----------- UI/AddSeries/New/SearchResultView.js | 9 +++------ 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/UI/AddSeries/Existing/ImportSeriesView.js b/UI/AddSeries/Existing/ImportSeriesView.js index 38e97ec9f..5a11be338 100644 --- a/UI/AddSeries/Existing/ImportSeriesView.js +++ b/UI/AddSeries/Existing/ImportSeriesView.js @@ -2,10 +2,9 @@ define([ 'app', 'AddSeries/RootFolders/RootFolderCollection', 'Quality/QualityProfileCollection', - 'Shared/NotificationCollection', 'AddSeries/Existing/UnmappedFolderModel', 'AddSeries/Collection', - 'Series/SeriesModel'], function (app, rootFolders, qualityProfileCollection, notificationCollection) { + 'Series/SeriesModel'], function (app, rootFolders, qualityProfileCollection) { NzbDrone.AddSeries.Existing.FolderMatchResultView = Backbone.Marionette.ItemView.extend({ template: 'AddSeries/SearchResultTemplate', @@ -34,19 +33,12 @@ define([ this.model.set('rootFolderId', rootFolderId); this.model.set('folder', folder); - var seriesCollection = new NzbDrone.AddSeries.Collection(); - seriesCollection.add(this.model); - this.model.save(undefined, { success: function () { - var notificationModel = new NzbDrone.Shared.NotificationModel({ - tvDbId : self.model.get('tvDbId'), - title : 'Added', - message: self.model.get('title'), - level : 'success' + NzbDrone.Shared.Messenger.show({ + message: 'Added: ' + self.model.get('title') }); - notificationCollection.push(notificationModel); NzbDrone.vent.trigger(NzbDrone.Events.SeriesAdded, { existing: true, series: self.model }); self.trigger('seriesAdded'); self.close(); diff --git a/UI/AddSeries/New/SearchResultView.js b/UI/AddSeries/New/SearchResultView.js index 1147d4a5a..ea2a73578 100644 --- a/UI/AddSeries/New/SearchResultView.js +++ b/UI/AddSeries/New/SearchResultView.js @@ -1,5 +1,5 @@ 'use strict'; -define(['app', 'Shared/NotificationCollection', 'Series/SeriesCollection'], function (app, notificationCollection) { +define(['app', 'Series/SeriesCollection'], function (app) { NzbDrone.AddSeries.New.SearchItemView = Backbone.Marionette.ItemView.extend({ @@ -32,13 +32,10 @@ define(['app', 'Shared/NotificationCollection', 'Series/SeriesCollection'], func this.model.save(undefined, { url : NzbDrone.Series.SeriesCollection.prototype.url, success: function () { - var notificationModel = new NzbDrone.Shared.NotificationModel({ - title : 'Added', - message: self.model.get('title'), - level : 'success' + NzbDrone.Shared.Messenger.show({ + message: 'Added: ' + self.model.get('title') }); - notificationCollection.push(notificationModel); NzbDrone.vent.trigger(NzbDrone.Events.SeriesAdded, { existing: false, series: self.model }); } });