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.
Sonarr/src/UI/AddSeries/SearchResultCollectionView.js

36 lines
942 B

10 years ago
'use strict';
11 years ago
define(
[
'marionette',
'AddSeries/SearchResultView'
], function (Marionette, SearchResultView) {
11 years ago
return Marionette.CollectionView.extend({
itemView: SearchResultView,
initialize: function (options) {
this.isExisting = options.isExisting;
this.showing = 1;
},
showAll: function () {
this.showingAll = true;
this.render();
},
showMore: function () {
this.showing += 5;
this.render();
return this.showing >= this.collection.length;
},
appendHtml: function (collectionView, itemView, index) {
if (!this.isExisting || index < this.showing || index === 0) {
collectionView.$el.append(itemView.el);
}
11 years ago
}
});
});