Added events when series are added

This commit is contained in:
Mark McDowall 2013-04-12 08:08:09 -07:00
commit d663d9cd5a
4 changed files with 22 additions and 2 deletions

View file

@ -13,6 +13,19 @@ define(['app', 'AddSeries/RootFolders/RootFolderCollection', 'AddSeries/New/Sear
},
collection: new NzbDrone.Series.SeriesCollection(),
initialize: function () {
NzbDrone.AddSeries.New.AddNewSeriesContext = this;
NzbDrone.vent.on(NzbDrone.Events.SeriesAdded, function (options){
if (!options.existing) {
NzbDrone.AddSeries.New.AddNewSeriesContext.ui.seriesSearch.val('');
//Todo: Figure out why this is inconsistent
options.series.collection.reset();
}
});
},
onRender: function () {
var self = this;

View file

@ -38,7 +38,7 @@ define(['app', 'Shared/NotificationCollection', 'Series/SeriesCollection'], func
});
notificationCollection.push(notificationModel);
self.close();
NzbDrone.vent.trigger(NzbDrone.Events.SeriesAdded, { existing: false, series: self.model });
}
});
}