http://www.mediawiki.org/wiki/Special:Code/MediaWiki/82900

Revision: 82900
Author:   janpaul123
Date:     2011-02-27 17:14:01 +0000 (Sun, 27 Feb 2011)
Log Message:
-----------
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.

Modified Paths:
--------------
    trunk/extensions/WikiEditor/modules/jquery.wikiEditor.dialogs.js

Modified: trunk/extensions/WikiEditor/modules/jquery.wikiEditor.dialogs.js
===================================================================
--- trunk/extensions/WikiEditor/modules/jquery.wikiEditor.dialogs.js    
2011-02-27 16:36:22 UTC (rev 82899)
+++ trunk/extensions/WikiEditor/modules/jquery.wikiEditor.dialogs.js    
2011-02-27 17:14:01 UTC (rev 82900)
@@ -84,7 +84,12 @@
                                        }
                                }
                        }
-                       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' ) ) {


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to