2020-11-18 09:11:12 +00:00
|
|
|
var Settings = require( 'ext.RevisionSlider.Settings' ),
|
|
|
|
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' );
|
|
|
|
}
|
|
|
|
} );
|