Bug 40538: Simplify code

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Jonathan Druart 2025-07-29 12:36:35 +02:00 committed by Lucas Gass
parent 805c5ba3cc
commit 50c9ec4340
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
1 changed files with 13 additions and 12 deletions

View File

@ -386,12 +386,13 @@ $(document).ready(function () {
"</a>"
);
} else {
const link = document.createElement("a");
link.classList.add(
"hold-suspend",
"btn",
"btn-default",
"btn-xs"
const link = Object.assign(
document.createElement("a"),
{
className:
"hold-suspend btn btn-default btn-xs",
textContent: " " + __("Suspend"),
}
);
link.setAttribute(
"data-hold-id",
@ -401,13 +402,13 @@ $(document).ready(function () {
"data-hold-title",
oObj.title
);
link.textContent = " " + __("Suspend");
const icon = document.createElement("i");
icon.classList.add("fa", "fa-pause");
link.insertAdjacentElement(
"afterbegin",
icon
const icon = Object.assign(
document.createElement("i"),
{
className: "fa fa-pause",
}
);
link.prepend(icon);
return link.outerHTML;
}
},