From 4b5ba42cacc3f85d763af0a14498f72d545a4a9f Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 1 Oct 2024 14:15:07 +0200 Subject: [PATCH] Bug 38049: Call .tooltip() only if needed This is cheating, yes. We had a cypress test failing because of this line $(...).tooltip is not a function It's failing randomly on Admin/RecordSources_spec.ts, which does not need the tooltip. Signed-off-by: David Nind Signed-off-by: Pedro Amorim Signed-off-by: Katrin Fischer --- koha-tmpl/intranet-tmpl/prog/js/staff-global.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js index cfb6769f0d..1eb53b2f43 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js +++ b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js @@ -381,7 +381,10 @@ $(document).ready(function () { $("#setlibrary_panel").removeClass("setlibrary_panel_open").html("").hide(); }); - $('[data-bs-toggle="tooltip"]').tooltip(); + if ( $('[data-bs-toggle="tooltip"]').length ) { + $('[data-bs-toggle="tooltip"]').tooltip(); + } + }); function removeLastBorrower() { -- 2.39.5