Switch jquery.sortable to use mw-sortable and mw-unsortable classes, to be in line...
authorDerk-Jan Hartman <hartman@users.mediawiki.org>
Thu, 23 Jun 2011 21:26:21 +0000 (21:26 +0000)
committerDerk-Jan Hartman <hartman@users.mediawiki.org>
Thu, 23 Jun 2011 21:26:21 +0000 (21:26 +0000)
Follow up to r86088

resources/jquery/jquery.tablesorter.js
resources/mediawiki.page/mediawiki.page.ready.js
tests/qunit/suites/resources/jquery/jquery.tablesorter.test.js

index 3f8c28c..03016fd 100644 (file)
                                        this.order = 0;
                                        this.count = 0;
 
-                                       if ( $( this ).is( '.unsortable' ) ) this.sortDisabled = true;
+                                       if ( $( this ).is( '.unsortable, .mw-unsortable' ) ) this.sortDisabled = true;
 
                                        if ( !this.sortDisabled ) {
                                                var $th = $( this ).addClass( table.config.cssHeader ).attr( 'title', msg[1] );
index c9f4ad4..319f8cd 100644 (file)
@@ -9,9 +9,9 @@ jQuery( document ).ready( function( $ ) {
        $( '.mw-collapsible' ).makeCollapsible();
 
        /* Lazy load jquery.tablesorter */
-       if ( $( 'table.sortable' ).length ) {
+       if ( $( 'table.mw-sortable, table.sortable' ).length ) {
                mw.loader.using( 'jquery.tablesorter', function() {
-                       $( 'table.sortable' ).tablesorter();
+                       $( 'table.mw-sortable, table.sortable' ).tablesorter();
                });
        }
 
index 5fadade..26e963d 100644 (file)
@@ -21,7 +21,7 @@ test( '-- Initial check', function() {
  * @return jQuery
  */
 var tableCreate = function( header, data ) {
-       var $table = $('<table class="sortable"><thead></thead><tbody></tbody></table>'),
+       var $table = $('<table class="mw-sortable"><thead></thead><tbody></tbody></table>'),
                $thead = $table.find('thead'),
                $tbody = $table.find('tbody');
        var $tr = $('<tr>');