reverted checkbox class and added method to controller

This commit is contained in:
Alex 2018-03-03 10:30:44 -05:00 committed by Julian Descottes
parent dae08107e2
commit 64cd724139
2 changed files with 8 additions and 4 deletions

View File

@ -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 () {

View File

@ -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>