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 <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Owen Leonard 2024-08-28 10:56:38 +00:00 committed by Katrin Fischer
parent 5b63d200a8
commit df1ec831bf
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
19 changed files with 4 additions and 41 deletions

View File

@ -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 },

View File

@ -764,8 +764,6 @@
e.preventDefault();
alert(_("This fund has sub funds. It cannot be deleted."));
});
$('[data-bs-toggle="tooltip"]').tooltip();
});
</script>
[% END %]

View File

@ -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();
});
</script>
[% END %]

View File

@ -318,7 +318,7 @@
[% branches_str = branches_str _ "\n" _ branch.branchname _ " (" _ branch.branchcode _ ")" %]
[% END %]
[% END %]
<span class="library_limitation" title="[% branches_str | html %]">
<span class="library_limitation" data-bs-toggle="tooltip" title="[% branches_str | html %]">
[% IF loo.branches.size > 1 %]
<span>[% loo.branches.size | html %] library limitations</span>
[% 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?"));

View File

@ -495,12 +495,13 @@
[% library_str = library_str _ "\n" _ library.branchname _ " (" _ library.branchcode _ ")" %]
[% END %]
[% END %]
<span class="library_limitation" title="[% library_str | html %]">
<span class="library_limitation" data-bs-toggle="tooltip" title="[% library_str | html %]">
[% IF library_limits.count > 1 %]
<span>[% library_limits.count | html %] library limitations</span>
[% ELSE %]
<span>[% library_limits.count | html %] library limitation</span>
[% END %]
</span>
[% ELSE %]
<span>No limitation</span>
[% 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");
}

View File

@ -543,8 +543,6 @@
if ($filter_container.data('filter')) {
$('#filter').val($filter_container.data('filter'));
}
$('[data-bs-toggle="tooltip"]').tooltip();
});
</script>
[% END %]

View File

@ -1625,7 +1625,6 @@
$("#return_date_remember").hide();
}
});
$('[data-bs-toggle="tooltip"]').tooltip();
$(".printcheckinslip").on("click", function(e){
e.preventDefault();

View File

@ -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 ) {

View File

@ -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"));
}
});
});
</script>
[% END %]

View File

@ -806,8 +806,6 @@
}
$(document).ready(function () {
$("#info_digests").tooltip();
$("#finesholdsissues a[data-bs-toggle='tab']").on(
"shown.bs.tab",
function (e) {

View File

@ -1965,8 +1965,6 @@
load_group_subgroups();
[% END %]
$('[data-bs-toggle="tooltip"]').tooltip();
$('#limit').change(function() {
$('#limitselect').submit();
});

View File

@ -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){

View File

@ -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");

View File

@ -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");

View File

@ -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();
});

View File

@ -84,6 +84,4 @@ $(document).ready(function() {
"pagingType": "full",
"autoWidth": false,
}, stock_rotation_table_settings);
$('[data-bs-toggle="tooltip"]').tooltip();
});

View File

@ -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();
});

View File

@ -373,6 +373,7 @@ $(document).ready(function () {
$("#setlibrary_panel").removeClass("setlibrary_panel_open").html("").hide();
});
$('[data-bs-toggle="tooltip"]').tooltip();
});
function removeLastBorrower() {

View File

@ -263,8 +263,6 @@
[% INCLUDE 'datatables.inc' %]
<script>
$(document).ready(function(){
$("#info_digests").tooltip();
function toggle_digest(id){
let PhoneNotification = [% Koha.Preference('PhoneNotification') || 0 | html %];
let TalkingTechItivaPhoneNotification = [% Koha.Preference('TalkingTechItivaPhoneNotification') || 0 | html %];