From 64cd72413995cd49f940c0680978eb1bbddab1bd Mon Sep 17 00:00:00 2001 From: Alex Date: Sat, 3 Mar 2018 10:30:44 -0500 Subject: [PATCH] reverted checkbox class and added method to controller --- .../settings/exportimage/ZipExportController.js | 10 +++++++--- src/templates/settings/export/zip.html | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/js/controller/settings/exportimage/ZipExportController.js b/src/js/controller/settings/exportimage/ZipExportController.js index 92eaaa43..f9ef2b0c 100644 --- a/src/js/controller/settings/exportimage/ZipExportController.js +++ b/src/js/controller/settings/exportimage/ZipExportController.js @@ -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 () { diff --git a/src/templates/settings/export/zip.html b/src/templates/settings/export/zip.html index f18b186f..c113daca 100644 --- a/src/templates/settings/export/zip.html +++ b/src/templates/settings/export/zip.html @@ -11,7 +11,7 @@ -
+