Skip to content
Snippets Groups Projects
Commit 089c6b3a authored by Piotr Gawron's avatar Piotr Gawron
Browse files

when removing overlay confirmation dialog is added

parent ac2b56e1
No related branches found
No related tags found
1 merge request!173Resolve "create a confirm button when removing data overlay"
Pipeline #
......@@ -240,16 +240,16 @@ OverlayPanel.prototype.openEditOverlayDialog = function (overlay) {
}, {
text: "REMOVE",
click: function () {
self.getMap().removeSelectedLayout(overlay.getId());
var windowSelf = this;
return ServerConnector.removeOverlay({
overlayId: overlay.getId()
}).then(function () {
return self.refresh();
}).then(function () {
$(windowSelf).dialog("close");
}).then(null, GuiConnector.alert);
return GuiConnector.showConfirmationDialog({
message: "Do you want to delete overlay: " + overlay.getName() + "?"
}).then(function (confirmation) {
if (confirmation) {
return self.removeOverlay(overlay).then(function () {
$(windowSelf).dialog("close");
}).then(null, GuiConnector.alert);
}
});
}
}, {
text: "CANCEL",
......@@ -400,6 +400,15 @@ OverlayPanel.prototype.init = function () {
return this.refresh(showDefault);
};
OverlayPanel.prototype.removeOverlay = function (overlay) {
self = this;
return self.getMap().removeSelectedLayout(overlay.getId()).then(function () {
return ServerConnector.removeOverlay({overlayId: overlay.getId()});
}).then(function () {
return self.refresh();
})
};
OverlayPanel.prototype.destroy = function () {
var self = this;
Panel.prototype.destroy.call(this);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment