mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RevisionSlider
synced 2024-11-28 01:00:08 +00:00
d369701709
Change-Id: I984404dd216fff469d7891f4f69a92d83d19d1c4
23 lines
583 B
JavaScript
23 lines
583 B
JavaScript
( function () {
|
|
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' );
|
|
}
|
|
} );
|
|
|
|
}() );
|