mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/WikiEditor
synced 2024-11-24 00:06:49 +00:00
Fixes bug when having multiple textareas, which is caused by the fact that dialogs are kept in memory for performance, even when selecting a different textarea.
This commit is contained in:
parent
ef3a3a06f7
commit
9df5838aa5
|
@ -84,7 +84,12 @@ fn: {
|
|||
}
|
||||
}
|
||||
}
|
||||
if ( !filtered && $.wikiEditor.isSupported( module ) && $( '#' + module.id ).size() == 0 ) {
|
||||
// If the dialog already exists, but for another textarea, simply remove it
|
||||
var $existingDialog = $( '#' + module.id );
|
||||
if ( $existingDialog.size() > 0 && $existingDialog.data( 'context' ).$textarea != context.$textarea ) {
|
||||
$existingDialog.remove();
|
||||
}
|
||||
if ( !filtered && $.wikiEditor.isSupported( module ) && $existingDialog.size() == 0 ) {
|
||||
$.wikiEditor.modules.dialogs.modules[mod] = module;
|
||||
// If this dialog requires the iframe, set it up
|
||||
if ( typeof context.$iframe == 'undefined' && $.wikiEditor.isRequired( module, 'iframe' ) ) {
|
||||
|
|
Loading…
Reference in a new issue