UI Cleanup - Updated AddSeries subtree.

This commit is contained in:
Taloth Saldono
2015-02-13 22:04:05 +01:00
parent b556eda4a0
commit f5118fc430
15 changed files with 311 additions and 186 deletions
+11 -6
View File
@@ -2,22 +2,27 @@ var Marionette = require('marionette');
var SearchResultView = require('./SearchResultView');
module.exports = Marionette.CollectionView.extend({
itemView : SearchResultView,
initialize : function(options){
itemView : SearchResultView,
initialize : function(options) {
this.isExisting = options.isExisting;
this.showing = 1;
},
showAll : function(){
showAll : function() {
this.showingAll = true;
this.render();
},
showMore : function(){
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) {
appendHtml : function(collectionView, itemView, index) {
if (!this.isExisting || index < this.showing || index === 0) {
collectionView.$el.append(itemView.el);
}
}