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) {
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 {
......
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