You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
'use strict';
|
|
|
|
|
define(
|
|
|
|
|
[
|
|
|
|
|
'marionette',
|
|
|
|
|
'AddSeries/SearchResultView',
|
|
|
|
|
|
|
|
|
|
], function (Marionette, SearchResultView) {
|
|
|
|
|
|
|
|
|
|
return Marionette.CollectionView.extend({
|
|
|
|
|
|
|
|
|
|
itemView: SearchResultView,
|
|
|
|
|
|
|
|
|
|
initialize: function (options) {
|
|
|
|
|
|
|
|
|
|
this.isExisting = options.isExisting;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
showAll: function () {
|
|
|
|
|
this.showingAll = true;
|
|
|
|
|
this.render();
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
appendHtml: function (collectionView, itemView, index) {
|
|
|
|
|
if (!this.isExisting || this.showingAll || index === 0) {
|
|
|
|
|
collectionView.$el.append(itemView.el);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
});
|