From df1ec831bfc33e3ef46cce5afaef04abebc4f886 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 28 Aug 2024 10:56:38 +0000 Subject: [PATCH] Bug 37748: (follow-up) Move tooltip initialization to staff-global.js This patch moves generic initializations of Bootstrap tooltips into staff-global.js. Templates which included custom tooltip initialization have been updated to use the global function. Signed-off-by: Jonathan Druart Signed-off-by: Katrin Fischer --- .../intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt | 2 -- koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tt | 2 -- koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqplan.tt | 2 -- .../prog/en/modules/admin/authorised_values.tt | 3 +-- koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt | 4 ++-- .../prog/en/modules/admin/marc-overlay-rules.tt | 2 -- koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt | 1 - koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs.tt | 3 --- .../prog/en/modules/course_reserves/course-details.tt | 6 ------ .../intranet-tmpl/prog/en/modules/members/moremember.tt | 2 -- .../prog/en/modules/reports/guided_reports_start.tt | 2 -- koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload.tt | 1 - koha-tmpl/intranet-tmpl/prog/js/catalog.js | 4 ---- koha-tmpl/intranet-tmpl/prog/js/members-menu.js | 1 - .../intranet-tmpl/prog/js/messaging-preference-form.js | 4 ---- koha-tmpl/intranet-tmpl/prog/js/pages/stockrotation.js | 2 -- koha-tmpl/intranet-tmpl/prog/js/serials-toolbar.js | 1 - koha-tmpl/intranet-tmpl/prog/js/staff-global.js | 1 + koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt | 2 -- 19 files changed, 4 insertions(+), 41 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt index 264f96fbd8..375787a3f4 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt @@ -567,8 +567,6 @@ $("#budgetsTabs li:eq([% tab | html %]) a").tab("show"); [% END %] - $('[data-bs-toggle="tooltip"]').tooltip(); - $("#activeperiodst,#inactiveperiodst").dataTable($.extend(true, {}, dataTablesDefaults, { "columnDefs": [ { "targets": [ -1 ], "orderable": false, "searchable": false }, diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tt index 686e6f4df2..11b61995f7 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tt @@ -764,8 +764,6 @@ e.preventDefault(); alert(_("This fund has sub funds. It cannot be deleted.")); }); - - $('[data-bs-toggle="tooltip"]').tooltip(); }); [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqplan.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqplan.tt index 3d5c1c79d7..add5ae79ed 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqplan.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqplan.tt @@ -345,8 +345,6 @@ $("#budget_est_"+budget_id).text($("#budget_tot_"+budget_id).prev().text()); $("#budget_est_"+budget_id).css("color","green"); }); - - $('[data-bs-toggle="tooltip"]').tooltip(); }); [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt index 6c65fa63a7..068c932e07 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt @@ -318,7 +318,7 @@ [% branches_str = branches_str _ "\n" _ branch.branchname _ " (" _ branch.branchcode _ ")" %] [% END %] [% END %] - + [% IF loo.branches.size > 1 %] [% loo.branches.size | html %] library limitations [% ELSE %] @@ -421,7 +421,6 @@ $('#category_search').change(function() { $('#category').submit(); }); - $(".library_limitation").tooltip(); $("#delete_category").on('submit', function(){ return confirm(_("Are you sure you want to delete this authorized value category?")); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt index bc19c0e755..81f6c319dc 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt @@ -495,12 +495,13 @@ [% library_str = library_str _ "\n" _ library.branchname _ " (" _ library.branchcode _ ")" %] [% END %] [% END %] - + [% IF library_limits.count > 1 %] [% library_limits.count | html %] library limitations [% ELSE %] [% library_limits.count | html %] library limitation [% END %] + [% ELSE %] No limitation [% END %] @@ -560,7 +561,6 @@ $("#itemtype").on("blur",function(){ toUC(this); }); - $(".library_limitation").tooltip(); if( $("#icons .tab-pane.active").length < 1 ){ $("#icons a:first").tab("show"); } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc-overlay-rules.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc-overlay-rules.tt index b46a9b4c7e..c2d5b2c3e8 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc-overlay-rules.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc-overlay-rules.tt @@ -543,8 +543,6 @@ if ($filter_container.data('filter')) { $('#filter').val($filter_container.data('filter')); } - - $('[data-bs-toggle="tooltip"]').tooltip(); }); [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt index 74c2e23570..b4cbc64bb9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt @@ -1625,7 +1625,6 @@ $("#return_date_remember").hide(); } }); - $('[data-bs-toggle="tooltip"]').tooltip(); $(".printcheckinslip").on("click", function(e){ e.preventDefault(); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs.tt index fe0be53700..7ccbcffcad 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs.tt @@ -200,9 +200,6 @@ var club_id = $(this).data("id"); SearchToHold( club_id ); }); - $('[data-bs-toggle="tooltip"]').on("click",function(e){ - e.stopPropagation(); - }).tooltip(); }); function ConfirmDeleteTemplate( id, name ) { diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt index d08f8888f2..27cb90917c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt @@ -363,12 +363,6 @@ return confirmDelete(_("Are you sure you want to delete this course?")); [% END %] }); - $(".disabled").tooltip().on("click", function(e){ - e.preventDefault(); - if( $(this).hasClass("checkedout") ){ - alert(_("This item cannot be removed. It is checked out")); - } - }); }); [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt index eb3c49eaf9..99d09c2707 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt @@ -806,8 +806,6 @@ } $(document).ready(function () { - $("#info_digests").tooltip(); - $("#finesholdsissues a[data-bs-toggle='tab']").on( "shown.bs.tab", function (e) { diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt index 0e4db35ff1..16065ab7ed 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt @@ -1965,8 +1965,6 @@ load_group_subgroups(); [% END %] - $('[data-bs-toggle="tooltip"]').tooltip(); - $('#limit').change(function() { $('#limitselect').submit(); }); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload.tt index 12f32a0c13..5dfdafdcce 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload.tt @@ -528,7 +528,6 @@ }); if ( window.isSecureContext ) { - $('[data-bs-toggle="tooltip"]').tooltip(); $(".get-file").on("click", function(e){ e.preventDefault(); if( navigator.clipboard && navigator.clipboard.writeText){ diff --git a/koha-tmpl/intranet-tmpl/prog/js/catalog.js b/koha-tmpl/intranet-tmpl/prog/js/catalog.js index 93cf5f9cfd..ec37cb0894 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/catalog.js +++ b/koha-tmpl/intranet-tmpl/prog/js/catalog.js @@ -118,10 +118,6 @@ $(document).ready(function() { }); $("#export").remove(); // Hide embedded export form if JS menus available - $('[data-bs-toggle="tooltip"]').on("click",function(e){ - e.stopPropagation(); - }).tooltip(); - $(".addtolist").on("click", function (e) { e.preventDefault(); var shelfnumber = $(this).data("shelfnumber"); diff --git a/koha-tmpl/intranet-tmpl/prog/js/members-menu.js b/koha-tmpl/intranet-tmpl/prog/js/members-menu.js index c61323ed4b..09afae4801 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/members-menu.js +++ b/koha-tmpl/intranet-tmpl/prog/js/members-menu.js @@ -39,7 +39,6 @@ $(document).ready(function(){ return window.confirm( __("Are you sure you want to delete this message? This cannot be undone.") ); }); - $("#updatechild, #patronflags, #renewpatron, #deletepatron, #exportbarcodes").tooltip(); $("#exportcheckins").click(function(){ export_barcodes(); $(".btn-group").removeClass("open"); diff --git a/koha-tmpl/intranet-tmpl/prog/js/messaging-preference-form.js b/koha-tmpl/intranet-tmpl/prog/js/messaging-preference-form.js index 1e1cbdf73e..7e8fe2eefb 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/messaging-preference-form.js +++ b/koha-tmpl/intranet-tmpl/prog/js/messaging-preference-form.js @@ -1,6 +1,4 @@ $(document).ready(function(){ - $("#info_digests").tooltip(); - var message_prefs_dirty = false; $('#memberentry_messaging_prefs > *').change(function() { message_prefs_dirty = true; @@ -78,6 +76,4 @@ $(document).ready(function(){ $(".pmp_phone").click(function(){ toggle_digest(Number($(this).attr("id").replace("phone", ""))); }); - - $('#memberentry_messaging_prefs [data-bs-toggle="tooltip"][disabled]').tooltip(); }); diff --git a/koha-tmpl/intranet-tmpl/prog/js/pages/stockrotation.js b/koha-tmpl/intranet-tmpl/prog/js/pages/stockrotation.js index da01b81a1f..9b702933ae 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/pages/stockrotation.js +++ b/koha-tmpl/intranet-tmpl/prog/js/pages/stockrotation.js @@ -84,6 +84,4 @@ $(document).ready(function() { "pagingType": "full", "autoWidth": false, }, stock_rotation_table_settings); - - $('[data-bs-toggle="tooltip"]').tooltip(); }); diff --git a/koha-tmpl/intranet-tmpl/prog/js/serials-toolbar.js b/koha-tmpl/intranet-tmpl/prog/js/serials-toolbar.js index a5952048c2..2ebaf6ad2f 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/serials-toolbar.js +++ b/koha-tmpl/intranet-tmpl/prog/js/serials-toolbar.js @@ -21,5 +21,4 @@ function popup(subscriptionid) { $("#mana-subscription-share").click(function() { window.location="subscription-detail.pl?subscriptionid=" + subscriptionid + "&op=share"; }); - $('[data-bs-toggle="tooltip"]').tooltip(); }); diff --git a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js index e7f32193e1..e357c8b398 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js +++ b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js @@ -373,6 +373,7 @@ $(document).ready(function () { $("#setlibrary_panel").removeClass("setlibrary_panel_open").html("").hide(); }); + $('[data-bs-toggle="tooltip"]').tooltip(); }); function removeLastBorrower() { diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt index 072ab17d01..c25147453d 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt @@ -263,8 +263,6 @@ [% INCLUDE 'datatables.inc' %]