diff --git a/UI/AddSeries/AddSeriesTemplate.html b/UI/AddSeries/AddSeriesTemplate.html index 696eb92f7..518a5ed15 100644 --- a/UI/AddSeries/AddSeriesTemplate.html +++ b/UI/AddSeries/AddSeriesTemplate.html @@ -1,14 +1,17 @@ {{#if folder.path}} -
+
{{folder.path}}
-
-{{/if}} +
{{/if}}
@@ -17,4 +20,4 @@ +
{{debug}} diff --git a/UI/AddSeries/AddSeriesView.js b/UI/AddSeries/AddSeriesView.js index e3815a3a5..e66b1e891 100644 --- a/UI/AddSeries/AddSeriesView.js +++ b/UI/AddSeries/AddSeriesView.js @@ -60,10 +60,10 @@ define( _onLoadMore: function () { var showingAll = this.resultCollectionView.showMore(); + this.ui.searchBar.show(); if (showingAll) { this.ui.loadMore.hide(); - this.ui.searchBar.show(); } }, @@ -94,7 +94,7 @@ define( this.collection.reset(); if (!options.term || options.term === this.collection.term) { - return; + return $.Deferred().resolve(); } this.searchResult.show(new LoadingView()); @@ -102,6 +102,8 @@ define( this.currentSearchPromise = this.collection.fetch({ data: { term: options.term } }); + + return this.currentSearchPromise; }, _showResults: function () { diff --git a/UI/AddSeries/Existing/CollectionView.js b/UI/AddSeries/Existing/CollectionView.js index e5added59..74108d33d 100644 --- a/UI/AddSeries/Existing/CollectionView.js +++ b/UI/AddSeries/Existing/CollectionView.js @@ -20,17 +20,18 @@ define( }, _showAndSearch: function (index) { - + var self = this; var model = this.collection.at(index); if (model) { - var self = this; var currentIndex = index; var folderName = model.get('folder').name; this.addItemView(model, this.getItemView(), index); - $.when(this.children.findByModel(model).search({term: folderName})).then(function () { - self._showAndSearch(currentIndex + 1); - }); + this.children.findByModel(model) + .search({term: folderName}) + .always((function () { + self._showAndSearch(currentIndex + 1); + })); } },