Merge "mediawiki.action.edit: Support dynamically inserted form fields"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 6 May 2013 20:55:52 +0000 (20:55 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 6 May 2013 20:55:52 +0000 (20:55 +0000)
resources/mediawiki.action/mediawiki.action.edit.js

index 2835c9c..fc1b18d 100644 (file)
                        }
                }() );
 
-               $( 'textarea, input:text' ).focus( function () {
-                       currentFocused = $(this);
-               });
+               // Apply to dynamically created textboxes as well as normal ones
+               $( document ).on( 'focus', 'textarea, input:text', function () {
+                       currentFocused = $( this );
+               } );
 
                // HACK: make currentFocused work with the usability iframe
                // With proper focus detection support (HTML 5!) this'll be much cleaner