mirror of
https://github.com/lidarr/Lidarr
synced 2025-01-31 03:11:51 +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',
|
'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 () {
|
||||||
|
if (this.releaseCollection.length === 0) {
|
||||||
|
this.mainView = new NoResultsView();
|
||||||
|
}
|
||||||
|
|
||||||
|
else {
|
||||||
this.mainView = new ManualSearchLayout({ collection: this.releaseCollection });
|
this.mainView = new ManualSearchLayout({ collection: this.releaseCollection });
|
||||||
|
}
|
||||||
|
|
||||||
this._showMainView();
|
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