From a2d7a32b2f267b496997210459e02a7446b96ac1 Mon Sep 17 00:00:00 2001 From: Allan Jardine Date: Sat, 16 Oct 2010 10:59:21 +0100 Subject: [PATCH] Fixed: Sorting disabled classes were not being correctly applied if sorting was disabled. This was particularly obvious with jQuery UI theming - 3064 --- media/js/jquery.dataTables.js | 7 ++++++- media/unit_testing/tests_onhold/1_dom/bSort.js | 6 ++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/media/js/jquery.dataTables.js b/media/js/jquery.dataTables.js index 0c8b6280..69d7220a 100644 --- a/media/js/jquery.dataTables.js +++ b/media/js/jquery.dataTables.js @@ -4500,7 +4500,7 @@ * Purpose: Set the sortting classes on the header * Returns: - * Inputs: object:oSettings - dataTables settings object - * Notes: It is safe to call this function when bSort is false + * Notes: It is safe to call this function when bSort and bSortClasses are false */ function _fnSortingClasses( oSettings ) { @@ -6660,6 +6660,11 @@ } } } + + /* Do a first pass on the sorting classes (allows any size changes to be taken into + * account, and also will apply sorting disabled classes if disabled + */ + _fnSortingClasses( oSettings ); /* * Final init diff --git a/media/unit_testing/tests_onhold/1_dom/bSort.js b/media/unit_testing/tests_onhold/1_dom/bSort.js index 6ca81167..ecaf168e 100755 --- a/media/unit_testing/tests_onhold/1_dom/bSort.js +++ b/media/unit_testing/tests_onhold/1_dom/bSort.js @@ -65,6 +65,12 @@ $(document).ready( function () { function () { return $('#example tbody td:eq(3)').html() == "4"; } ); + oTest.fnTest( + "Disabled classes applied", + null, + function () { return $('#example thead th:eq(0)').hasClass('sorting_disabled'); } + ); + oTest.fnTest( "Click on second column has no effect", function () { $('#example thead th:eq(1)').click(); },