|
|
@ -4,29 +4,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
NzbDrone.AddSeries.SearchItemView = Backbone.Marionette.ItemView.extend({
|
|
|
|
NzbDrone.AddSeries.SearchItemView = Backbone.Marionette.ItemView.extend({
|
|
|
|
|
|
|
|
|
|
|
|
tagName: 'li',
|
|
|
|
|
|
|
|
template: "AddSeries/AddNewSeries/SearchResultTemplate",
|
|
|
|
template: "AddSeries/AddNewSeries/SearchResultTemplate",
|
|
|
|
itemView: NzbDrone.AddSeries.SearchResultModel,
|
|
|
|
className: 'row',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
initialize: function () {
|
|
|
|
initialize: function () {
|
|
|
|
|
|
|
|
this.listenTo(this.model, 'reset', function () { alert('model'); });
|
|
|
|
this.collection = new NzbDrone.AddSeries.SearchResultCollection();
|
|
|
|
|
|
|
|
this.bindTo(this.collection, 'reset', this.render);
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onRender: function () {
|
|
|
|
|
|
|
|
NzbDrone.ModelBinder.bind(this.model, this.el);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
NzbDrone.AddSeries.SearchResultView = Backbone.Marionette.CollectionView.extend({
|
|
|
|
NzbDrone.AddSeries.SearchResultView = Backbone.Marionette.CollectionView.extend({
|
|
|
|
|
|
|
|
|
|
|
|
tagName: 'ul',
|
|
|
|
|
|
|
|
className: 'result',
|
|
|
|
className: 'result',
|
|
|
|
itemView: NzbDrone.AddSeries.SearchResultModel,
|
|
|
|
itemView: NzbDrone.AddSeries.SearchItemView,
|
|
|
|
|
|
|
|
|
|
|
|
collection : new NzbDrone.AddSeries.SearchResultCollection(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
initialize: function () {
|
|
|
|
initialize: function () {
|
|
|
|
//this.collection = new NzbDrone.AddSeries.SearchResultCollection();
|
|
|
|
|
|
|
|
this.listenTo(this.collection, 'reset', this.render);
|
|
|
|
this.listenTo(this.collection, 'reset', this.render);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
@ -57,7 +52,7 @@ NzbDrone.AddSeries.AddNewSeriesView = Backbone.Marionette.Layout.extend({
|
|
|
|
self.$el.data('timeout', setTimeout(self.search, 500, self));
|
|
|
|
self.$el.data('timeout', setTimeout(self.search, 500, self));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
this.searchResult.show(new NzbDrone.AddSeries.SearchResultView());
|
|
|
|
this.searchResult.show(new NzbDrone.AddSeries.SearchResultView({ collection: this.collection }));
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
search: function (context) {
|
|
|
|
search: function (context) {
|
|
|
|