2013-06-21 04:43:58 +03:00
|
|
|
'use strict';
|
|
|
|
define(
|
|
|
|
[
|
|
|
|
'marionette',
|
2013-06-22 03:48:23 +03:00
|
|
|
'AddSeries/SearchResultView',
|
|
|
|
|
2013-06-30 22:57:26 +03:00
|
|
|
], function (Marionette, SearchResultView) {
|
2013-06-21 04:43:58 +03:00
|
|
|
|
|
|
|
return Marionette.CollectionView.extend({
|
|
|
|
|
2013-06-22 03:48:23 +03:00
|
|
|
itemView: SearchResultView,
|
|
|
|
|
|
|
|
initialize: function (options) {
|
|
|
|
|
|
|
|
this.isExisting = options.isExisting;
|
|
|
|
},
|
|
|
|
|
|
|
|
showAll: function () {
|
|
|
|
this.showingAll = true;
|
|
|
|
this.render();
|
|
|
|
},
|
|
|
|
|
2013-06-30 22:57:26 +03:00
|
|
|
appendHtml: function (collectionView, itemView, index) {
|
|
|
|
if (!this.isExisting || this.showingAll || index === 0) {
|
|
|
|
collectionView.$el.append(itemView.el);
|
2013-06-22 03:48:23 +03:00
|
|
|
}
|
2013-06-21 04:43:58 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|