1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-16 11:37:58 +02:00
Sonarr/UI/AddSeries/SearchResultCollectionView.js
2013-06-30 12:57:41 -07:00

31 lines
728 B
JavaScript

'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);
}
}
});
});