Commit 089c6b3a authored by Piotr Gawron's avatar Piotr Gawron
Browse files

when removing overlay confirmation dialog is added

parent ac2b56e1
Pipeline #3102 passed with stage
in 56 seconds
......@@ -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);
......
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