Added search button/menu to series details grid

Also fixed some names to make name navigation easier.
This commit is contained in:
Mark McDowall 2013-09-18 22:49:15 -07:00
commit 7320342123
11 changed files with 120 additions and 11 deletions

View file

@ -3,12 +3,12 @@ define(
[
'marionette',
'Episode/Summary/EpisodeSummaryLayout',
'Episode/Search/Layout',
'Episode/Search/EpisodeSearchLayout',
'Series/SeriesCollection'
], function (Marionette, SummaryLayout, SearchLayout, SeriesCollection) {
return Marionette.Layout.extend({
template: 'Episode/LayoutTemplate',
template: 'Episode/EpisodeDetailsLayoutTemplate',
regions: {
summary : '#episode-summary',
@ -38,11 +38,21 @@ define(
this.series = SeriesCollection.find({ id: this.model.get('seriesId') });
this.templateHelpers.series = this.series.toJSON();
this.openingTab = options.openingTab || 'summary'
},
onShow: function () {
this._showSummary();
this.searchLayout = new SearchLayout({ model: this.model });
if (this.openingTab === 'search') {
this.searchLayout.startManualSearch = true;
this._showSearch();
}
else {
this._showSummary();
}
this._setMonitoredState();
},

View file

@ -12,7 +12,7 @@ define(
], function (App, Marionette, ButtonsView, ManualSearchLayout, ReleaseCollection, SeriesCollection,CommandController, LoadingView) {
return Marionette.Layout.extend({
template: 'Episode/Search/LayoutTemplate',
template: 'Episode/Search/EpisodeSearchLayoutTemplate',
regions: {
main: '#episode-search-region'
@ -29,7 +29,13 @@ define(
},
onShow: function () {
this._showMainView();
if (this.startManualSearch) {
this._searchManual();
}
else {
this._showMainView();
}
},
_searchAuto: function (e) {