Avoid creating emptystring promptclass.
This commit is contained in:
parent
14ab3f3b06
commit
67a3472aad
1 changed files with 11 additions and 2 deletions
|
@ -278,7 +278,13 @@ function init_button_with_confirm(button)
|
|||
button.classList.remove("button_with_confirm");
|
||||
|
||||
const holder = document.createElement("span");
|
||||
holder.className = "confirm_holder " + (button.dataset.holderClass || "");
|
||||
holder.className = ("confirm_holder " + (button.dataset.holderClass || "")).trim();
|
||||
delete button.dataset.holderClass;
|
||||
if (button.dataset.holderId)
|
||||
{
|
||||
holder.id = button.dataset.holderId;
|
||||
delete button.dataset.holderId;
|
||||
}
|
||||
button.parentElement.insertBefore(holder, button);
|
||||
|
||||
const holder_stage1 = document.createElement("span");
|
||||
|
@ -304,7 +310,10 @@ function init_button_with_confirm(button)
|
|||
prompt.innerText = (button.dataset.prompt || "Are you sure?") + " ";
|
||||
input_source = undefined;
|
||||
}
|
||||
prompt.className = button.dataset.promptClass || "";
|
||||
if (button.dataset.promptClass)
|
||||
{
|
||||
prompt.className = button.dataset.promptClass;
|
||||
}
|
||||
holder_stage2.appendChild(prompt)
|
||||
delete button.dataset.prompt;
|
||||
delete button.dataset.promptClass;
|
||||
|
|
Loading…
Reference in a new issue