1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-09 04:22:30 +01:00
Radarr/UI/AddSeries/SearchResultCollectionView.js

37 lines
947 B
JavaScript
Raw Normal View History

2013-06-21 03:43:58 +02:00
'use strict';
define(
[
'marionette',
'AddSeries/SearchResultView',
2013-06-30 21:57:26 +02:00
], function (Marionette, SearchResultView) {
2013-06-21 03:43:58 +02:00
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;
},
2013-06-30 21:57:26 +02:00
appendHtml: function (collectionView, itemView, index) {
if (!this.isExisting || index < this.showing || index === 0) {
2013-06-30 21:57:26 +02:00
collectionView.$el.append(itemView.el);
}
2013-06-21 03:43:58 +02:00
}
});
});