mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-30 05:45:31 +02:00
95% done with hiding existing movies
This commit is contained in:
@@ -1,12 +1,21 @@
|
||||
var Marionette = require('marionette');
|
||||
var SearchResultView = require('./SearchResultView');
|
||||
var vent = require('vent');
|
||||
|
||||
module.exports = Marionette.CollectionView.extend({
|
||||
itemView : SearchResultView,
|
||||
|
||||
initialize : function(options) {
|
||||
this.showExisting = true;
|
||||
this.isExisting = options.isExisting;
|
||||
this.showing = 1;
|
||||
vent.on(vent.Commands.ShowExistingCommand, this._onExistingToggle.bind(this));
|
||||
},
|
||||
|
||||
_onExistingToggle : function(data) {
|
||||
this.showExisting = data.showExisting;
|
||||
|
||||
this.render();
|
||||
},
|
||||
|
||||
showAll : function() {
|
||||
@@ -34,8 +43,17 @@ module.exports = Marionette.CollectionView.extend({
|
||||
},
|
||||
|
||||
appendHtml : function(collectionView, itemView, index) {
|
||||
if (!this.isExisting || index < this.showing || index === 0) {
|
||||
collectionView.$el.append(itemView.el);
|
||||
if(this.isExisting) {
|
||||
if(this.showExisting) {
|
||||
if (index < this.showing || index === 0) {
|
||||
collectionView.$el.append(itemView.el);
|
||||
}
|
||||
}
|
||||
} else if(!this.isExisting) {
|
||||
if (index < this.showing || index === 0) {
|
||||
collectionView.$el.append(itemView.el);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user