Fixed: show no results found when manual search returns 0 results

pull/3113/head
Mark McDowall 11 years ago
parent 14f57d655a
commit b185748822

@ -8,8 +8,9 @@ define(
'Release/ReleaseCollection', 'Release/ReleaseCollection',
'Series/SeriesCollection', 'Series/SeriesCollection',
'Commands/CommandController', 'Commands/CommandController',
'Shared/LoadingView' 'Shared/LoadingView',
], function (vent, Marionette, ButtonsView, ManualSearchLayout, ReleaseCollection, SeriesCollection,CommandController, LoadingView) { 'Episode/Search/NoResultsView'
], function (vent, Marionette, ButtonsView, ManualSearchLayout, ReleaseCollection, SeriesCollection,CommandController, LoadingView, NoResultsView) {
return Marionette.Layout.extend({ return Marionette.Layout.extend({
template: 'Episode/Search/EpisodeSearchLayoutTemplate', template: 'Episode/Search/EpisodeSearchLayoutTemplate',
@ -73,7 +74,14 @@ define(
}, },
_showSearchResults: function () { _showSearchResults: function () {
this.mainView = new ManualSearchLayout({ collection: this.releaseCollection }); if (this.releaseCollection.length === 0) {
this.mainView = new NoResultsView();
}
else {
this.mainView = new ManualSearchLayout({ collection: this.releaseCollection });
}
this._showMainView(); this._showMainView();
} }
}); });

@ -0,0 +1,10 @@
'use strict';
define(
[
'marionette'
], function (Marionette) {
return Marionette.ItemView.extend({
template: 'Episode/Search/NoResultsViewTemplate'
});
});

@ -0,0 +1 @@
<div>No results found</div>
Loading…
Cancel
Save