mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RevisionSlider
synced 2024-11-16 03:53:18 +00:00
548019e16d
On tapping Enter or Space the Rev-Slider Opens Bug: T199212 Change-Id: I08ab018c3e89d25ab8d4e72963e9cbd4971f7068
22 lines
554 B
JavaScript
22 lines
554 B
JavaScript
( function ( mw, $ ) {
|
|
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();
|
|
}
|
|
} );
|
|
|
|
}( mediaWiki, jQuery ) );
|