Only show "Display Existing Movies" toggle after selecting a folder

pull/2/head
Tim Turner 8 years ago
parent e3e67d1098
commit 7ca53d1073

@ -13,7 +13,11 @@ module.exports = Marionette.Layout.extend({
template : 'AddMovies/AddMoviesLayoutTemplate', template : 'AddMovies/AddMoviesLayoutTemplate',
regions : { regions : {
workspace : '#add-movies-workspace' workspace : '#add-movies-workspace',
},
ui : {
$existing : '#show-existing-movies-toggle'
}, },
events : { events : {
@ -32,8 +36,6 @@ module.exports = Marionette.Layout.extend({
RootFolderCollection.fetch().done(function() { RootFolderCollection.fetch().done(function() {
RootFolderCollection.synced = true; RootFolderCollection.synced = true;
}); });
}, },
_toggleExisting : function(e) { _toggleExisting : function(e) {
@ -45,12 +47,15 @@ module.exports = Marionette.Layout.extend({
}, },
onShow : function() { onShow : function() {
this.workspace.show(new AddMoviesView()); this.workspace.show(new AddMoviesView());
this.ui.$existing.hide();
}, },
_folderSelected : function(options) { _folderSelected : function(options) {
vent.trigger(vent.Commands.CloseModalCommand); vent.trigger(vent.Commands.CloseModalCommand);
this.ui.$existing.show();
this.workspace.show(new ExistingMoviesCollectionView({ model : options.model })); this.workspace.show(new ExistingMoviesCollectionView({ model : options.model }));
}, },
@ -65,6 +70,7 @@ module.exports = Marionette.Layout.extend({
}, },
_addFromList : function() { _addFromList : function() {
this.ui.$existing.hide();
this.workspace.show(new AddFromListView()); this.workspace.show(new AddFromListView());
} }
}); });

@ -13,6 +13,7 @@
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<div class="form-horizontal" style="margin-top: 15px;"> <div class="form-horizontal" style="margin-top: 15px;">
<div id="show-existing-movies-toggle">
<div class="form-group" style="margin-bottom: 0px;"> <div class="form-group" style="margin-bottom: 0px;">
<label class="col-sm-3 control-label">Display Existing Movies</label> <label class="col-sm-3 control-label">Display Existing Movies</label>
@ -36,6 +37,7 @@
</div> </div>
</div> </div>
</div> </div>
</div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">

Loading…
Cancel
Save