Fix bug 31604.

Table should now load the tablesorter if needed, and make sure that the table is sortable.
This commit is contained in:
Derk-Jan Hartman 2011-10-22 17:21:03 +00:00
parent 4086233665
commit 11aabbd4a9
Notes: Derk-Jan Hartman 2011-10-22 17:21:03 +00:00

View file

@ -779,8 +779,11 @@ getDefaultConfig: function () {
.addClass( 'sortable' )
.insertAfter( $( '#wikieditor-toolbar-table-preview' ) )
.hide();
if ( typeof jQuery.fn.tablesorter == 'function' )
$( '#wikieditor-toolbar-table-preview2' ).tablesorter();
mw.loader.using( 'jquery.tablesorter', function() {
$( '#wikieditor-toolbar-table-preview2' ).tablesorter();
});
$( '#wikieditor-toolbar-table-sortable' ).click( function() {
// Swap the currently shown one clone with the other one
$( '#wikieditor-toolbar-table-preview' )