Commit da458097 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

during closing/opening overlays checkbox is blocked

parent 25d0e0d9
...@@ -160,11 +160,17 @@ OverlayPanel.prototype.createOverlayRow = function (overlay, checked) { ...@@ -160,11 +160,17 @@ OverlayPanel.prototype.createOverlayRow = function (overlay, checked) {
checkbox.type = "checkbox"; checkbox.type = "checkbox";
checkbox.checked = checked; checkbox.checked = checked;
checkbox.onclick = function () { checkbox.onclick = function () {
if (this.checked) { var thisCheckbox = this;
return self.getMap().openDataOverlay(overlay.getId()).then(null, GuiConnector.alert); var toggleOverlayPromise;
if (thisCheckbox.checked) {
toggleOverlayPromise = self.getMap().openDataOverlay(overlay.getId());
} else { } 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); viewTd.appendChild(checkbox);
} else { } else {
......
Markdown is supported
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