From 2619b17339a96e7feb8688ff7593a85ca794f407 Mon Sep 17 00:00:00 2001 From: Azgaar Date: Sun, 29 Mar 2020 00:37:23 +0300 Subject: [PATCH] v1.3.06a --- modules/ui/states-editor.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/modules/ui/states-editor.js b/modules/ui/states-editor.js index eb29adb3..91ae1513 100644 --- a/modules/ui/states-editor.js +++ b/modules/ui/states-editor.js @@ -46,7 +46,7 @@ function editStates() { if (cl.contains("icon-star-empty")) stateCapitalZoomIn(state); else if (cl.contains("culturePopulation")) changePopulation(state); else if (cl.contains("icon-pin")) focusOnState(state, cl); else - if (cl.contains("icon-trash-empty")) stateRemove(state); + if (cl.contains("icon-trash-empty")) stateRemovePrompt(state); }); body.addEventListener("input", function(ev) { @@ -411,8 +411,22 @@ function editStates() { if (!defs.selectAll("#fog path").size()) fogging.style("display", "none"); // all items are de-focused } - function stateRemove(state) { + function stateRemovePrompt(state) { if (customization) return; + + alertMessage.innerHTML = "Are you sure you want to remove the state?
This action cannot be reverted"; + $("#alert").dialog({resizable: false, title: "Remove state", + buttons: { + Remove: function() { + $(this).dialog("close"); + stateRemove(state); + }, + Cancel: function() {$(this).dialog("close");} + } + }); + } + + function stateRemove(state) { statesBody.select("#state"+state).remove(); statesBody.select("#state-gap"+state).remove(); statesHalo.select("#state-border"+state).remove();