From c91875922a69490a06c45e4c0a5cdaf9c2c68afa 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. --- 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 e357c8b3986..adb1090135b 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js +++ b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js @@ -373,7 +373,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.34.1