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,25 +36,26 @@ 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) {
var showExisting = e.target.checked; var showExisting = e.target.checked;
vent.trigger(vent.Commands.ShowExistingCommand, { vent.trigger(vent.Commands.ShowExistingCommand, {
showExisting: showExisting showExisting: showExisting
}); });
}, },
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());
} }
}); });

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