2018-11-16 16:33:52 +00:00
|
|
|
( function () {
|
2020-03-29 20:21:28 +00:00
|
|
|
var Settings = require( 'ext.RevisionSlider.Settings' ),
|
|
|
|
settings = new Settings(),
|
2016-11-23 18:43:31 +00:00
|
|
|
autoExpand = settings.shouldAutoExpand();
|
|
|
|
|
|
|
|
if ( autoExpand ) {
|
|
|
|
mw.loader.load( 'ext.RevisionSlider.init' );
|
|
|
|
} else {
|
2019-02-10 16:54:28 +00:00
|
|
|
$( '.mw-revslider-toggle-button' ).on( 'click',
|
2016-11-23 18:43:31 +00:00
|
|
|
function () {
|
|
|
|
mw.loader.load( 'ext.RevisionSlider.init' );
|
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|
2019-02-10 16:54:28 +00:00
|
|
|
$( '.mw-revslider-toggle-button' ).on( 'keypress', function ( event ) {
|
2018-08-13 04:42:09 +00:00
|
|
|
if ( event.which === 13 || event.which === 32 ) {
|
|
|
|
event.preventDefault();
|
2019-02-10 16:54:28 +00:00
|
|
|
$( '.mw-revslider-toggle-button' ).trigger( 'click' );
|
2018-08-13 04:42:09 +00:00
|
|
|
}
|
|
|
|
} );
|
2016-11-23 18:43:31 +00:00
|
|
|
|
2018-11-16 16:33:52 +00:00
|
|
|
}() );
|