mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RevisionSlider
synced 2024-11-16 03:53:18 +00:00
e62f46dd80
Bug: T208951 Change-Id: Icf10ea6bbc09542e69c0cd583a4ee4f2f76a3f43
22 lines
528 B
JavaScript
22 lines
528 B
JavaScript
( function () {
|
|
var settings = new mw.libs.revisionSlider.Settings(),
|
|
autoExpand = settings.shouldAutoExpand();
|
|
|
|
if ( autoExpand ) {
|
|
mw.loader.load( 'ext.RevisionSlider.init' );
|
|
} else {
|
|
$( '.mw-revslider-toggle-button' ).click(
|
|
function () {
|
|
mw.loader.load( 'ext.RevisionSlider.init' );
|
|
}
|
|
);
|
|
}
|
|
$( '.mw-revslider-toggle-button' ).keypress( function ( event ) {
|
|
if ( event.which === 13 || event.which === 32 ) {
|
|
event.preventDefault();
|
|
$( '.mw-revslider-toggle-button' ).click();
|
|
}
|
|
} );
|
|
|
|
}() );
|