mirror of https://github.com/Radarr/Radarr
Added events when series are added
This commit is contained in:
parent
6e88f55a54
commit
d663d9cd5a
|
@ -34,6 +34,8 @@ define([
|
||||||
});
|
});
|
||||||
|
|
||||||
notificationCollection.push(notificationModel);
|
notificationCollection.push(notificationModel);
|
||||||
|
NzbDrone.vent.trigger(NzbDrone.Events.SeriesAdded, { existing: true, series: self.model });
|
||||||
|
self.trigger('seriesAdded');
|
||||||
self.close();
|
self.close();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -60,6 +62,10 @@ define([
|
||||||
initialize: function () {
|
initialize: function () {
|
||||||
this.collection = new NzbDrone.Series.SeriesCollection();
|
this.collection = new NzbDrone.Series.SeriesCollection();
|
||||||
this.collection.bind('reset', this.collectionReset, this);
|
this.collection.bind('reset', this.collectionReset, this);
|
||||||
|
|
||||||
|
this.on("itemview:seriesAdded", function(){
|
||||||
|
this.close();
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
onRender: function () {
|
onRender: function () {
|
||||||
|
|
|
@ -13,6 +13,19 @@ define(['app', 'AddSeries/RootFolders/RootFolderCollection', 'AddSeries/New/Sear
|
||||||
},
|
},
|
||||||
collection: new NzbDrone.Series.SeriesCollection(),
|
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 () {
|
onRender: function () {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ define(['app', 'Shared/NotificationCollection', 'Series/SeriesCollection'], func
|
||||||
});
|
});
|
||||||
|
|
||||||
notificationCollection.push(notificationModel);
|
notificationCollection.push(notificationModel);
|
||||||
self.close();
|
NzbDrone.vent.trigger(NzbDrone.Events.SeriesAdded, { existing: false, series: self.model });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,7 +58,8 @@ define('app', function () {
|
||||||
|
|
||||||
window.NzbDrone.Events = {
|
window.NzbDrone.Events = {
|
||||||
OpenModalDialog : 'openModal',
|
OpenModalDialog : 'openModal',
|
||||||
CloseModalDialog: 'closeModal'
|
CloseModalDialog: 'closeModal',
|
||||||
|
SeriesAdded: 'seriesAdded'
|
||||||
};
|
};
|
||||||
|
|
||||||
window.NzbDrone.Constants = {
|
window.NzbDrone.Constants = {
|
||||||
|
|
Loading…
Reference in New Issue