From c7e1c3a7e4b9b034344eb64c3088ea50f7c65068 Mon Sep 17 00:00:00 2001 From: Christopher Brannon Date: Fri, 10 Mar 2017 15:26:13 +0000 Subject: [PATCH] Bug 18211: Corrected intended id's in jquery. To test: 1) Checkout items - if you can, have items checked out from previous day too, but not necessary. 2) Review source code and see that the ids on the and for cells containing "Today's checkouts" and "Previous checkouts" labels have some crazy ids with partial html tags (strong) and other unnecessary elements. 3) Apply patch. 4) Examine source code again and see a better and smaller id. Signed-off-by: Owen Leonard --- .../lib/jquery/plugins/jquery.dataTables.rowGrouping.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/lib/jquery/plugins/jquery.dataTables.rowGrouping.js b/koha-tmpl/intranet-tmpl/lib/jquery/plugins/jquery.dataTables.rowGrouping.js index 126ff63..c1670f9 100644 --- a/koha-tmpl/intranet-tmpl/lib/jquery/plugins/jquery.dataTables.rowGrouping.js +++ b/koha-tmpl/intranet-tmpl/lib/jquery/plugins/jquery.dataTables.rowGrouping.js @@ -121,12 +121,11 @@ function fnCreateGroupRow(sGroupCleaned, sGroup, iColspan) { var nGroup = document.createElement('tr'); var nCell = document.createElement('td'); - nGroup.id = "group-id-" + oTable.attr("id") + "_" + sGroupCleaned; + nGroup.id = oTable.attr("id") + "_" + sGroupCleaned; var oGroup = { id: nGroup.id, key: sGroupCleaned, text: sGroup, level: 0, groupItemClass: ".group-item-" + sGroupCleaned, dataGroup: sGroupCleaned, aoSubgroups: new Array() }; - if (properties.bSetGroupingClassOnTR) { nGroup.className = properties.sGroupingClass + " " + sGroupCleaned; } else { @@ -248,7 +247,8 @@ function _fnGetCleanedGroup(sGroup) { if (sGroup === "") return "-"; - return sGroup.toLowerCase().replace(/[^a-zA-Z0-9\u0080-\uFFFF]+/g, "-"); //fix for unicode characters (Issue 23) + sGroup = $(sGroup).text(); + return sGroup.toLowerCase().replace(/[^a-zA-Z0-9\'\u0080-\uFFFF]+/g, "-").replace(/[\']+/g, ""); //fix for unicode characters (Issue 23) //return sGroup.toLowerCase().replace(/\W+/g, "-"); //Fix provided by bmathews (Issue 7) } @@ -687,4 +687,4 @@ }); }; -})(jQuery); \ No newline at end of file +})(jQuery); -- 2.1.4