mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RevisionSlider
synced 2024-11-14 19:24:42 +00:00
4ac1ff57f1
These are not needed any more, because the code runs in a seperate scope anyway. Change-Id: I939a06102f194a0c98021accb2f62be73dd0562f
20 lines
541 B
JavaScript
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' );
|
|
}
|
|
} );
|