mirror of
https://github.com/Radarr/Radarr.git
synced 2024-09-11 12:02:35 +02:00
Add existing series, load more will only load 5 results at a time
This commit is contained in:
parent
47e7805cf9
commit
3559d35d92
@ -25,11 +25,13 @@ define(
|
||||
},
|
||||
|
||||
_onLoadMore: function () {
|
||||
this.ui.loadMore.hide();
|
||||
this.ui.searchBar.show();
|
||||
this.resultCollectionView.showAll();
|
||||
},
|
||||
var showingAll = this.resultCollectionView.showMore();
|
||||
|
||||
if (showingAll) {
|
||||
this.ui.loadMore.hide();
|
||||
this.ui.searchBar.show();
|
||||
}
|
||||
},
|
||||
|
||||
initialize: function (options) {
|
||||
this.collection = new AddSeriesCollection({unmappedFolderModel: this.model});
|
||||
|
@ -11,8 +11,8 @@ define(
|
||||
itemView: SearchResultView,
|
||||
|
||||
initialize: function (options) {
|
||||
|
||||
this.isExisting = options.isExisting;
|
||||
this.showing = 1;
|
||||
},
|
||||
|
||||
showAll: function () {
|
||||
@ -20,11 +20,17 @@ define(
|
||||
this.render();
|
||||
},
|
||||
|
||||
showMore: function () {
|
||||
this.showing += 5;
|
||||
this.render();
|
||||
|
||||
return this.showing >= this.collection.length;
|
||||
},
|
||||
|
||||
appendHtml: function (collectionView, itemView, index) {
|
||||
if (!this.isExisting || this.showingAll || index === 0) {
|
||||
if (!this.isExisting || index < this.showing || index === 0) {
|
||||
collectionView.$el.append(itemView.el);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
@ -10,7 +10,7 @@
|
||||
.existing-series {
|
||||
|
||||
.card();
|
||||
margin : 20px 0px;
|
||||
margin : 30px 0px;
|
||||
|
||||
.add-series-search {
|
||||
width : 970px;
|
||||
|
@ -34,6 +34,11 @@ define(
|
||||
icon : 'icon-book',
|
||||
route: 'logs'
|
||||
},
|
||||
{
|
||||
title: 'Check for Update',
|
||||
icon: 'icon-download-alt',
|
||||
command: 'applicationUpdate'
|
||||
},
|
||||
// {
|
||||
// title : 'Restart',
|
||||
// icon : 'icon-repeat',
|
||||
|
Loading…
Reference in New Issue
Block a user