mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/WikiEditor
synced 2024-11-24 00:06:49 +00:00
Explicit load module 'jquery.tablesorter' instead of use when loaded
The module 'jquery.tablesorter' is already loaded a few lines above. The previous situation depends on a race-condition of the function is called or not. Change-Id: If6777fcc7d9d49604eb78b6d233a32898fc82446
This commit is contained in:
parent
744dd98914
commit
278ae63c04
|
@ -889,15 +889,16 @@
|
|||
// Instead of show/hiding, switch the HTML around
|
||||
// We do this because the sortable tables script styles the first row,
|
||||
// visible or not
|
||||
var headerHTML = $( '.wikieditor-toolbar-table-preview-header' ).html(),
|
||||
var $sortable,
|
||||
headerHTML = $( '.wikieditor-toolbar-table-preview-header' ).html(),
|
||||
hiddenHTML = $( '.wikieditor-toolbar-table-preview-hidden' ).html();
|
||||
$( '.wikieditor-toolbar-table-preview-header' ).html( hiddenHTML );
|
||||
$( '.wikieditor-toolbar-table-preview-hidden' ).html( headerHTML );
|
||||
if ( typeof jQuery.fn.tablesorter === 'function' ) {
|
||||
$( '#wikieditor-toolbar-table-preview, #wikieditor-toolbar-table-preview2' )
|
||||
.filter( '.sortable' )
|
||||
.tablesorter();
|
||||
}
|
||||
$sortable = $( '#wikieditor-toolbar-table-preview, #wikieditor-toolbar-table-preview2' )
|
||||
.filter( '.sortable' );
|
||||
mw.loader.using( 'jquery.tablesorter', function () {
|
||||
$sortable.tablesorter();
|
||||
} );
|
||||
} );
|
||||
},
|
||||
dialog: {
|
||||
|
|
Loading…
Reference in a new issue