Commit 6192cdc8 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge branch '267-disable-checkbox-when-overlay-is-loaded' into 'devel_11.0.x'

during closing/opening overlays checkbox is blocked

See merge request piotr.gawron/minerva!182
parents 25d0e0d9 da458097
......@@ -160,11 +160,17 @@ OverlayPanel.prototype.createOverlayRow = function (overlay, checked) {
checkbox.type = "checkbox";
checkbox.checked = checked;
checkbox.onclick = function () {
if (this.checked) {
return self.getMap().openDataOverlay(overlay.getId()).then(null, GuiConnector.alert);
var thisCheckbox = this;
var toggleOverlayPromise;
if (thisCheckbox.checked) {
toggleOverlayPromise = self.getMap().openDataOverlay(overlay.getId());
} else {
return self.getMap().removeSelectedLayout(overlay.getId()).then(null, GuiConnector.alert);
toggleOverlayPromise = self.getMap().removeSelectedLayout(overlay.getId());
}
$(thisCheckbox).prop("disabled", true);
return toggleOverlayPromise.then(null, GuiConnector.alert).finally(function () {
$(thisCheckbox).prop("disabled", false);
});
};
viewTd.appendChild(checkbox);
} else {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment