Skip to content

Commit

Permalink
reverted checkbox class and added method to controller
Browse files Browse the repository at this point in the history
  • Loading branch information
sharpfives authored and juliandescottes committed Mar 3, 2018
1 parent dae0810 commit 64cd724
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions src/js/controller/settings/exportimage/ZipExportController.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,20 @@
this.splitByLayersCheckbox = document.querySelector('.zip-split-layers-checkbox');
this.addEventListener(this.splitByLayersCheckbox, 'change', this.onSplitLayersClick_);

this.useLayerNamesCheckboxContainer = document.querySelector('.use-layer-names-checkbox-container');
this.useLayerNamesContainer = document.querySelector('.use-layer-names-container');
this.useLayerNamesCheckbox = document.querySelector('.zip-use-layer-names-checkbox');
this.useLayerNamesCheckboxContainer.hidden = !this.splitByLayersCheckbox.checked;
this.toggleHideUseLayerNamesCheckbox();

var zipButton = document.querySelector('.zip-generate-button');
this.addEventListener(zipButton, 'click', this.onZipButtonClick_);
};

ns.ZipExportController.prototype.toggleHideUseLayerNamesCheckbox = function () {
this.useLayerNamesContainer.style.display = (this.splitByLayersCheckbox.checked ? 'block' : 'none');
};

ns.ZipExportController.prototype.onSplitLayersClick_ = function () {
this.useLayerNamesCheckboxContainer.hidden = !this.splitByLayersCheckbox.checked;
this.toggleHideUseLayerNamesCheckbox();
};

ns.ZipExportController.prototype.onZipButtonClick_ = function () {
Expand Down
2 changes: 1 addition & 1 deletion src/templates/settings/export/zip.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<input id="zip-split-layers" class="zip-split-layers-checkbox checkbox-fix" type="checkbox" />
<label for="zip-split-layers">Split by layers</label>
</div>
<div class="use-layer-names-checkbox-container" style="margin: 5px 0;">
<div class="checkbox-container use-layer-names-container" style="margin: 5px 0;">
<input id="zip-use-layer-names" class="zip-use-layer-names-checkbox checkbox-fix" type="checkbox" />
<label for="zip-use-layer-names">Index by layer names</label>
</div>
Expand Down

0 comments on commit 64cd724

Please sign in to comment.