From 531fb50d6b24df4a5215581d3666d0af12adefc9 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Fri, 4 Aug 2017 15:37:45 -0300 Subject: [PATCH] Bug 16759: (followup) Make it work with OpacSeparateHoldings This patch fixes columns_settings.inc so it works for all objects when the selector returns more than one object. To test: - Have the first patch applied - Verify it works correctly - Enable OpacSeparateHoldings - Reload => FAIL: Notice the second holdings tab doesn't have the visualization rules applied. - Apply this patch - Reload => SUCCESS: Rules applied correctly! - Sign off :-D Sponsored-by: Dover --- koha-tmpl/opac-tmpl/bootstrap/en/includes/columns_settings.inc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/columns_settings.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/columns_settings.inc index b065a35524..ed96de544a 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/columns_settings.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/columns_settings.inc @@ -25,10 +25,12 @@ function KohaTable(selector, dt_parameters, columns_settings) { text: _("Column visibility"), } ]; - var table = $(selector).dataTable($.extend(true, {}, dataTablesDefaults, dt_parameters)); - $(hidden_ids).each(function(index, value) { - table.fnSetColumnVis( value, false ); + $(selector).each(function(){ + var table = $(this).dataTable($.extend(true, {}, dataTablesDefaults, dt_parameters)); + $(hidden_ids).each(function(index, value) { + table.fnSetColumnVis(value, false); + }); }); return table; -- 2.13.4