mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/WikiEditor
synced 2024-09-23 10:26:26 +00:00
Create a toolbarReady hook for attaching toolbar tools
Using an event introduces a race condition where the extension adding the listener has to do so before WikiEditor finishes loading. Change-Id: I5a8dc6f8fd1b1939b5d98307b20ef1fd355cee99
This commit is contained in:
parent
d86e85e26d
commit
8e9d306510
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "WikiEditor",
|
||||
"version": "0.5.2",
|
||||
"version": "0.5.3",
|
||||
"author": [
|
||||
"Derk-Jan Hartman",
|
||||
"Trevor Parscal",
|
||||
|
|
|
@ -768,6 +768,8 @@
|
|||
}
|
||||
setTimeout( function () {
|
||||
context.$textarea.trigger( 'wikiEditor-toolbar-doneInitialSections' );
|
||||
// Use hook for attaching new toolbar tools to avoid race conditions
|
||||
mw.hook( 'wikiEditor.toolbarReady' ).fire( context.$textarea );
|
||||
} );
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue