rename button (resources) also stops evn propag
Signed-off-by: Victor Seiji Hariki <victorseijih@gmail.com>
This commit is contained in:
parent
aec096b856
commit
559f4493ca
1 changed files with 13 additions and 8 deletions
|
@ -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");
|
||||
|
|
Loading…
Reference in a new issue