From 651d105ad27afdb7aab34d18e81425b9f6502b1d 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 Edit: amended so it preserves the original semantic, returning the resulting table objects. Sponsored-by: Dover Signed-off-by: Owen Leonard Followed test plan, patch worked as described. Also passed QA test tool Signed-off-by: Alex Buckley --- .../opac-tmpl/bootstrap/en/includes/columns_settings.inc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 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 b065a35..9a04036 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/columns_settings.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/columns_settings.inc @@ -25,13 +25,16 @@ 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 ); + var tables = $(selector).map(function(){ + var table = $(this).dataTable($.extend(true, {}, dataTablesDefaults, dt_parameters)); + $(hidden_ids).each(function(index, value) { + table.fnSetColumnVis(value, false); + }); + return table; }); - return table; + return tables; } -- 2.1.4