mediawiki-extensions-Revisi.../modules/ext.RevisionSlider.lazy.js
Thiemo Kreuz 4ac1ff57f1 Remove closure wrappers from all JavaScript code
These are not needed any more, because the code runs in a
seperate scope anyway.

Change-Id: I939a06102f194a0c98021accb2f62be73dd0562f
2020-11-18 11:16:04 +01:00

20 lines
541 B
JavaScript

var Settings = require( 'ext.RevisionSlider.Settings' ),
settings = new Settings(),
autoExpand = settings.shouldAutoExpand();
if ( autoExpand ) {
mw.loader.load( 'ext.RevisionSlider.init' );
} else {
$( '.mw-revslider-toggle-button' ).on( 'click',
function () {
mw.loader.load( 'ext.RevisionSlider.init' );
}
);
}
$( '.mw-revslider-toggle-button' ).on( 'keypress', function ( event ) {
if ( event.which === 13 || event.which === 32 ) {
event.preventDefault();
$( '.mw-revslider-toggle-button' ).trigger( 'click' );
}
} );