From 1e4876536ff876ea61e90bd9b5b99533ffb82115 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Tue, 22 Jan 2013 12:17:55 -0500 Subject: [PATCH] Bug 9444 [Revised] Use DataTables in system preferences editor Replace the tablesorter plugin with the DataTables plugin in the "new" system preferences editor. To test, open the system preferences editor on any tab other than Local Use. Confirm that table sorting works correctly within each section. In this configuration there should be no pager and no results filtering. Revision corrects template path to datatables assets. Further revision fixes section-collapse JS Signed-off-by: Bernardo Gonzalez Kriegel Comment: Work as described. Collapsing restored. No errors. Signed-off-by: Jonathan Druart Signed-off-by: Jared Camins-Esakov --- .../prog/en/js/pages/preferences.js | 20 ++++++++++--------- .../prog/en/modules/admin/preferences.tt | 5 ++++- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/pages/preferences.js b/koha-tmpl/intranet-tmpl/prog/en/js/pages/preferences.js index 4d793a1e2e..96e9e99668 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/js/pages/preferences.js +++ b/koha-tmpl/intranet-tmpl/prog/en/js/pages/preferences.js @@ -1,10 +1,3 @@ -$(document).ready(function() { - $("table.preferences").tablesorter({ - sortList: [[0,0]], - headers: { 1: { sorter:false}} - }); -}); - // We can assume 'KOHA' exists, as we depend on KOHA.AJAX KOHA.Preferences = { @@ -40,6 +33,15 @@ KOHA.Preferences = { }; $( document ).ready( function () { + + $("table.preferences").dataTable($.extend(true, {}, dataTablesDefaults, { + "sDom": 't', + "aoColumnDefs": [ + { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false } + ], + "bPaginate": false + })); + function mark_modified() { $( this.form ).find( '.save-all' ).removeAttr( 'disabled' ); $( this ).addClass( 'modified' ); @@ -96,11 +98,11 @@ $( document ).ready( function () { $(collapsible).toggle( function () { $(this).addClass("collapsed").removeClass("expanded").attr("title",MSG_CLICK_TO_EXPAND); - $(this).next("table").hide(); + $(this).next("div").hide(); }, function () { $(this).addClass("expanded").removeClass("collapsed").attr("title",MSG_CLICK_TO_COLLAPSE); - $(this).next("table").show(); + $(this).next("div").show(); } ); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt index 5b20399be3..ebb9d8cac1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt @@ -1,7 +1,10 @@ [% INCLUDE 'doc-head-open.inc' %] Koha › Administration › System preferences [% INCLUDE 'doc-head-close.inc' %] - + + +[% INCLUDE 'datatables-strings.inc' %] +