Bug 31962: Add tooltip to 'configure' on datatable controls

This makes sure that the last button on the datatable controls
also has a tooltip, like the other buttons.

To test:
* Without the patch:
* Check out an item and look at the table of checkouts
* Look at the detail page of a record with at least one item
* Confirm that the 'configure' button doesn't have a tooltip appear
  as a bubble like the other buttons
* Apply patch
* Restart_all and reload pages
* Make sure the styling of the 'configure' tooltip now matches that
  of the other buttons

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 12ae2c59e7)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
This commit is contained in:
Katrin Fischer 2023-01-06 21:04:54 +00:00 committed by Jacob O'Mara
parent 6ad6eac6b7
commit 7866ff9083
2 changed files with 6 additions and 4 deletions

View file

@ -165,7 +165,8 @@ function KohaTable(id_selector, dt_parameters, table_settings, add_filters) {
dt_parameters[ "buttons" ].push(
{
className: "dt_button_configure_table",
titleAttr: _("Table settings"),
fade: 100,
titleAttr: _("Configure table"),
text: '<i class="fa fa-lg fa-wrench"></i> <span class="dt-button-text">' + _("Configure") + '</span>',
action: function() {
window.location = '/cgi-bin/koha/admin/columns_settings.pl?module=' + table_settings['module'] + '&page=' + table_settings['page'] + '&table=' + table_settings['table'];
@ -228,7 +229,7 @@ function KohaTable(id_selector, dt_parameters, table_settings, add_filters) {
deactivate_filters(id_selector);
}
$(".dt_button_clear_filter, .columns_controls, .export_controls").tooltip();
$(".dt_button_clear_filter, .columns_controls, .export_controls, .dt_button_configure_table").tooltip();
return table;
}

View file

@ -823,7 +823,8 @@ jQuery.fn.dataTable.ext.errMode = function(settings, note, message) {
settings[ "buttons" ].push(
{
className: "dt_button_configure_table",
titleAttr: __("Table settings"),
fade: 100,
titleAttr: __("Configure table"),
text: '<i class="fa fa-lg fa-wrench"></i> <span class="dt-button-text">' + __("Configure") + '</span>',
action: function() {
window.location = '/cgi-bin/koha/admin/columns_settings.pl?module=' + table_settings['module'] + '&page=' + table_settings['page'] + '&table=' + table_settings['table'];
@ -832,7 +833,7 @@ jQuery.fn.dataTable.ext.errMode = function(settings, note, message) {
);
}
$(".dt_button_clear_filter, .columns_controls, .export_controls").tooltip();
$(".dt_button_clear_filter, .columns_controls, .export_controls, .dt_button_configure_table").tooltip();
if ( add_filters ) {
settings['orderCellsTop'] = true;