rename button (resources) also stops evn propag

Signed-off-by: Victor Seiji Hariki <victorseijih@gmail.com>
This commit is contained in:
Victor Seiji Hariki 2022-12-04 08:31:43 -03:00
parent aec096b856
commit 559f4493ca

View file

@ -157,15 +157,20 @@ const stampTool = () =>
actionArray.classList.add("actions");
const renameButton = document.createElement("button");
renameButton.addEventListener("click", () => {
const name = prompt("Rename your resource:", resource.name);
if (name) {
resource.name = name;
resourceTitle.textContent = name;
renameButton.addEventListener(
"click",
(evn) => {
evn.stopPropagation();
const name = prompt("Rename your resource:", resource.name);
if (name) {
resource.name = name;
resourceTitle.textContent = name;
syncResources();
}
});
syncResources();
}
},
{passive: false}
);
renameButton.title = "Rename Resource";
renameButton.appendChild(document.createElement("div"));
renameButton.classList.add("rename-btn");