MediaWiki:Gadget-2006-toolbar.js: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
aggiungo un callback per permettere ad altri strumenti di capire quando la toolbar è pronta; piccolo refactoring: aggiungo 'mw' nel contesto locale
il callback ha senso fuori dalla textarea:focus per precaricare la toolbar
Riga 202:
// the queue
isReady = true;
 
// alert other scripts that this toolbar is ready
if( toolbar.callback ) {
toolbar.callback();
}
 
// Apply to dynamically created textboxes as well as normal ones
$( document ).on( 'focus', 'textarea, input:text', function () {
$currentFocused = $( this );
 
// alert other scripts that this toolbar is ready
if( toolbar.callback ) {
toolbar.callback();
}
} );
} );