'scripts' => 'resources/mediawiki.action/mediawiki.action.view.metadata.js',
'messages' => array( 'metadata-expand', 'metadata-collapse' ),
),
+ 'mediawiki.action.view.tablesorting' => array(
+ 'scripts' => 'resources/mediawiki.action/mediawiki.action.view.tablesorting.js',
+ ),
'mediawiki.action.watch.ajax' => array(
'scripts' => 'resources/mediawiki.action/mediawiki.action.watch.ajax.js',
'dependencies' => 'mediawiki.util',
--- /dev/null
+// Lazy load jquery.tablesorter
+
+( function( $ ) {
+ if ( $( 'table.sortable' ).length ) {
+ mw.loader.using( 'jquery.tablesorter', function() {
+ $( 'table.sortable' ).tablesorter();
+ } );
+ }
+} )( jQuery );
\ No newline at end of file
/* Enable CheckboxShiftClick */
$( 'input[type=checkbox]:not(.noshiftselect)' ).checkboxShiftClick();
- /* Enable Tablesorting */
- $( 'table.sortable' ).tablesorter();
-
/* Emulate placeholder if not supported by browser */
if ( !( 'placeholder' in document.createElement( 'input' ) ) ) {
$( 'input[placeholder]' ).placeholder();