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

This commit is contained in:
Tim Turner 2017-01-28 12:16:50 -05:00
parent e3e67d1098
commit 7ca53d1073
2 changed files with 34 additions and 26 deletions

View File

@ -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());
}
});

View File

@ -11,31 +11,33 @@
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="form-horizontal" style="margin-top: 15px;">
<div class="form-group" style="margin-bottom: 0px;">
<label class="col-sm-3 control-label">Display Existing Movies</label>
<div class="col-md-12">
<div class="form-horizontal" style="margin-top: 15px;">
<div id="show-existing-movies-toggle">
<div class="form-group" style="margin-bottom: 0px;">
<label class="col-sm-3 control-label">Display Existing Movies</label>
<div class="col-sm-8">
<div class="input-group">
<label class="checkbox toggle well">
<input class="x-show-existing" type="checkbox" checked="checked" name="showExisting"/>
<p>
<span>Yes</span>
<span>No</span>
</p>
<div class="col-sm-8">
<div class="input-group">
<label class="checkbox toggle well">
<input class="x-show-existing" type="checkbox" checked="checked" name="showExisting"/>
<p>
<span>Yes</span>
<span>No</span>
</p>
<div class="btn btn-primary slide-button"/>
</label>
<div class="btn btn-primary slide-button"/>
</label>
<span class="help-inline-checkbox">
<i class="icon-sonarr-form-info" title="Should Radarr display movies already in your collection?"/>
</span>
</div>
</div>
<span class="help-inline-checkbox">
<i class="icon-sonarr-form-info" title="Should Radarr display movies already in your collection?"/>
</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">