From 7ca53d10732d63e9d7d221e3125431e353a94d4b Mon Sep 17 00:00:00 2001 From: Tim Turner Date: Sat, 28 Jan 2017 12:16:50 -0500 Subject: [PATCH] Only show "Display Existing Movies" toggle after selecting a folder --- src/UI/AddMovies/AddMoviesLayout.js | 20 ++++++---- src/UI/AddMovies/AddMoviesLayoutTemplate.hbs | 40 ++++++++++---------- 2 files changed, 34 insertions(+), 26 deletions(-) diff --git a/src/UI/AddMovies/AddMoviesLayout.js b/src/UI/AddMovies/AddMoviesLayout.js index 00344bfdb..a219833e5 100644 --- a/src/UI/AddMovies/AddMoviesLayout.js +++ b/src/UI/AddMovies/AddMoviesLayout.js @@ -13,7 +13,11 @@ module.exports = Marionette.Layout.extend({ template : 'AddMovies/AddMoviesLayoutTemplate', regions : { - workspace : '#add-movies-workspace' + workspace : '#add-movies-workspace', + }, + + ui : { + $existing : '#show-existing-movies-toggle' }, events : { @@ -32,25 +36,26 @@ module.exports = Marionette.Layout.extend({ RootFolderCollection.fetch().done(function() { RootFolderCollection.synced = true; }); - - }, _toggleExisting : function(e) { - var showExisting = e.target.checked; + var showExisting = e.target.checked; - vent.trigger(vent.Commands.ShowExistingCommand, { - showExisting: showExisting - }); + vent.trigger(vent.Commands.ShowExistingCommand, { + showExisting: showExisting + }); }, onShow : function() { + this.workspace.show(new AddMoviesView()); + this.ui.$existing.hide(); }, _folderSelected : function(options) { vent.trigger(vent.Commands.CloseModalCommand); + this.ui.$existing.show(); this.workspace.show(new ExistingMoviesCollectionView({ model : options.model })); }, @@ -65,6 +70,7 @@ module.exports = Marionette.Layout.extend({ }, _addFromList : function() { + this.ui.$existing.hide(); this.workspace.show(new AddFromListView()); } }); diff --git a/src/UI/AddMovies/AddMoviesLayoutTemplate.hbs b/src/UI/AddMovies/AddMoviesLayoutTemplate.hbs index 0e251dcb7..48667d34c 100644 --- a/src/UI/AddMovies/AddMoviesLayoutTemplate.hbs +++ b/src/UI/AddMovies/AddMoviesLayoutTemplate.hbs @@ -11,31 +11,33 @@
-
-
-
- +
+
+
+
+ -
-
-
+
+