2023-06-22 09:41:37 +00:00
|
|
|
const Settings = require( 'ext.RevisionSlider.Settings' ),
|
2020-11-18 09:11:12 +00:00
|
|
|
settings = new Settings(),
|
|
|
|
autoExpand = settings.shouldAutoExpand();
|
2016-11-23 18:43:31 +00:00
|
|
|
|
2020-11-18 09:11:12 +00:00
|
|
|
if ( autoExpand ) {
|
|
|
|
mw.loader.load( 'ext.RevisionSlider.init' );
|
|
|
|
} else {
|
|
|
|
$( '.mw-revslider-toggle-button' ).on( 'click',
|
|
|
|
function () {
|
|
|
|
mw.loader.load( 'ext.RevisionSlider.init' );
|
2018-08-13 04:42:09 +00:00
|
|
|
}
|
2020-11-18 09:11:12 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
$( '.mw-revslider-toggle-button' ).on( 'keypress', function ( event ) {
|
|
|
|
if ( event.which === 13 || event.which === 32 ) {
|
|
|
|
event.preventDefault();
|
|
|
|
$( '.mw-revslider-toggle-button' ).trigger( 'click' );
|
|
|
|
}
|
|
|
|
} );
|