mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/WikiEditor
synced 2024-12-18 02:50:58 +00:00
Modules: Protect against loading modules twice
Bug: T189029 Change-Id: Ie0dff9c1dfa8e3a0927f2915a9a237dff739289a
This commit is contained in:
parent
db6c6f636b
commit
0161e37e6e
|
@ -274,7 +274,10 @@
|
|||
}
|
||||
}
|
||||
// Activate the module on this context
|
||||
if ( 'fn' in $.wikiEditor.modules[ module ] && 'create' in $.wikiEditor.modules[ module ].fn ) {
|
||||
if ( 'fn' in $.wikiEditor.modules[ module ] &&
|
||||
'create' in $.wikiEditor.modules[ module ].fn &&
|
||||
typeof context.modules[ module ] === 'undefined'
|
||||
) {
|
||||
// Add a place for the module to put it's own stuff
|
||||
context.modules[ module ] = {};
|
||||
// Tell the module to create itself on the context
|
||||
|
|
Loading…
Reference in a new issue