mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-12-16 11:37:58 +02:00
parent
536aa350f0
commit
2b72c0e328
@ -26,13 +26,8 @@ module.exports = Marionette.Layout.extend({
|
||||
],
|
||||
|
||||
initialize : function() {
|
||||
var self = this;
|
||||
|
||||
this.seriesCollection = SeriesCollection.clone();
|
||||
|
||||
_.each(this.seriesCollection.models, function (model) {
|
||||
model.collection = self.seriesCollection;
|
||||
});
|
||||
this._setModelCollection();
|
||||
|
||||
this.listenTo(this.seriesCollection, 'row:selected', this._onSelected);
|
||||
this.listenTo(this, 'modal:afterShow', this._setFocus);
|
||||
@ -83,6 +78,7 @@ module.exports = Marionette.Layout.extend({
|
||||
|
||||
_filter : function (term) {
|
||||
this.seriesCollection.setFilter(['title', term, 'contains']);
|
||||
this._setModelCollection();
|
||||
},
|
||||
|
||||
_onSelected : function (e) {
|
||||
@ -93,5 +89,13 @@ module.exports = Marionette.Layout.extend({
|
||||
|
||||
_setFocus : function () {
|
||||
this.ui.filter.focus();
|
||||
},
|
||||
|
||||
_setModelCollection: function () {
|
||||
var self = this;
|
||||
|
||||
_.each(this.seriesCollection.models, function (model) {
|
||||
model.collection = self.seriesCollection;
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user