From a85b4cf913fc34b75383705cf195d47bb685b634 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 29 Jul 2025 12:36:35 +0200 Subject: [PATCH] Bug 40538: Simplify code Signed-off-by: Marcel de Rooy --- koha-tmpl/intranet-tmpl/prog/js/holds.js | 25 ++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/holds.js b/koha-tmpl/intranet-tmpl/prog/js/holds.js index 043c2719f63..7d38de75143 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/holds.js +++ b/koha-tmpl/intranet-tmpl/prog/js/holds.js @@ -386,12 +386,13 @@ $(document).ready(function () { "" ); } 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; } }, -- 2.51.0