MediaWiki:Common.js: Difference between revisions
Content deleted Content added
No edit summary |
No edit summary |
||
| (One intermediate revision by the same user not shown) | |||
Line 26:
/**
* @source
* @rev 6
*/
Line 354:
});
/* Collapsible inline footnotes ({{footnote}}) — click-triggered
Clicking the "note" chip
class — there is nothing to mis-place, so the card can never open to
times, so the bot reads it from the parsed HTML regardless. Behaviour:▼
▲ dismiss; Enter/Space + aria-expanded for keyboard and screen readers. */
$( function () {
$( '.ed-fn-chip' ).attr( { role: 'button', tabindex: 0, 'aria-expanded': 'false' } );
Line 367:
$( '.ed-fn.ed-fn-open' ).each( function () {
if ( this !== except ) {
$( this ).removeClass( 'ed-fn-open
.children( '.ed-fn-chip' ).attr( 'aria-expanded', 'false' );
}
Line 382:
closeAll( $fn[ 0 ] );
$fn.toggleClass( 'ed-fn-open', willOpen );
$( this ).attr( 'aria-expanded', willOpen ? 'true' : 'false' );
} );
// click
$( document ).on( 'click', function ( e ) {
if ( !$( e.target ).closest( '.ed-fn' ).length ) {
| |||