\ No newline at end of file
diff --git a/UI/Episode/Search/Layout.js b/UI/Episode/Search/Layout.js
index 300b99a87..e6cbd1c61 100644
--- a/UI/Episode/Search/Layout.js
+++ b/UI/Episode/Search/Layout.js
@@ -3,12 +3,13 @@ define(
[
'app',
'marionette',
+ 'Episode/Search/ButtonsView',
'Episode/Search/ManualLayout',
'Release/Collection',
'Shared/SpinnerView',
'Shared/Messenger',
'Commands/CommandController'
- ], function (App, Marionette, ManualSearchLayout, ReleaseCollection, SpinnerView, Messenger, CommandController) {
+ ], function (App, Marionette, ButtonsView, ManualSearchLayout, ReleaseCollection, SpinnerView, Messenger, CommandController) {
return Marionette.Layout.extend({
template: 'Episode/Search/LayoutTemplate',
@@ -18,12 +19,17 @@ define(
},
events: {
- 'click .x-search-auto': '_searchAuto',
- 'click .x-search-manual': '_searchManual'
+ 'click .x-search-auto' : '_searchAuto',
+ 'click .x-search-manual': '_searchManual',
+ 'click .x-search-back' : '_showButtons'
+ },
+
+ initialize: function () {
+ this.mainView = new ButtonsView();
},
onShow: function () {
- this._releaseSearchActivated = false;
+ this._showMainView();
},
_searchAuto: function (e) {
@@ -50,22 +56,29 @@ define(
e.preventDefault();
}
- if (this._releaseSearchActivated) {
- return;
- }
-
var self = this;
- this.main.show(new SpinnerView());
+ this.mainView = new SpinnerView();
+ this._showMainView();
var releases = new ReleaseCollection();
var promise = releases.fetchEpisodeReleases(this.model.id);
promise.done(function () {
if (!self.isClosed) {
- self.main.show(new ManualSearchLayout({collection: releases}));
+ self.mainView = new ManualSearchLayout({collection: releases});
+ self._showMainView();
}
});
+ },
+
+ _showMainView: function () {
+ this.main.show(this.mainView);
+ },
+
+ _showButtons: function () {
+ this.mainView = new ButtonsView();
+ this._showMainView();
}
});
diff --git a/UI/Episode/Search/LayoutTemplate.html b/UI/Episode/Search/LayoutTemplate.html
index 547d6d631..a0db76df8 100644
--- a/UI/Episode/Search/LayoutTemplate.html
+++ b/UI/Episode/Search/LayoutTemplate.html
@@ -1,7 +1 @@
-
-
-
-
-
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/UI/Episode/Search/ManualLayoutTemplate.html b/UI/Episode/Search/ManualLayoutTemplate.html
index d90cd597d..84945e3bb 100644
--- a/UI/Episode/Search/ManualLayoutTemplate.html
+++ b/UI/Episode/Search/ManualLayoutTemplate.html
@@ -1 +1,2 @@
+
\ No newline at end of file