mirror of
https://github.com/Sonarr/Sonarr
synced 2025-01-02 13:14:58 +00:00
Fixed: show no results found when manual search returns 0 results
This commit is contained in:
parent
14f57d655a
commit
b185748822
3 changed files with 22 additions and 3 deletions
|
@ -8,8 +8,9 @@ define(
|
|||
'Release/ReleaseCollection',
|
||||
'Series/SeriesCollection',
|
||||
'Commands/CommandController',
|
||||
'Shared/LoadingView'
|
||||
], function (vent, Marionette, ButtonsView, ManualSearchLayout, ReleaseCollection, SeriesCollection,CommandController, LoadingView) {
|
||||
'Shared/LoadingView',
|
||||
'Episode/Search/NoResultsView'
|
||||
], function (vent, Marionette, ButtonsView, ManualSearchLayout, ReleaseCollection, SeriesCollection,CommandController, LoadingView, NoResultsView) {
|
||||
|
||||
return Marionette.Layout.extend({
|
||||
template: 'Episode/Search/EpisodeSearchLayoutTemplate',
|
||||
|
@ -73,7 +74,14 @@ define(
|
|||
},
|
||||
|
||||
_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();
|
||||
}
|
||||
});
|
||||
|
|
10
src/UI/Episode/Search/NoResultsView.js
Normal file
10
src/UI/Episode/Search/NoResultsView.js
Normal file
|
@ -0,0 +1,10 @@
|
|||
'use strict';
|
||||
|
||||
define(
|
||||
[
|
||||
'marionette'
|
||||
], function (Marionette) {
|
||||
return Marionette.ItemView.extend({
|
||||
template: 'Episode/Search/NoResultsViewTemplate'
|
||||
});
|
||||
});
|
1
src/UI/Episode/Search/NoResultsViewTemplate.html
Normal file
1
src/UI/Episode/Search/NoResultsViewTemplate.html
Normal file
|
@ -0,0 +1 @@
|
|||
<div>No results found</div>
|
Loading…
Reference in a new issue