]> git.mjollnir.org Git - moodle.git/commitdiff
Fix for bug 9646
authoranthonyforth <anthonyforth>
Mon, 30 Apr 2007 13:19:33 +0000 (13:19 +0000)
committeranthonyforth <anthonyforth>
Mon, 30 Apr 2007 13:19:33 +0000 (13:19 +0000)
lib/editor/htmlarea/htmlarea.php

index 1ec349e8f8cd51a442c2b69b42af17e705a428c9..d0f6fae42f706a56ab06ec4ac7ff0c5e8cfc8903 100644 (file)
@@ -639,7 +639,13 @@ HTMLArea.prototype.generate = function () {
     this._htmlArea = htmlarea;
 
     // insert the editor before the textarea.
-    textarea.parentNode.insertBefore(htmlarea, textarea);
+    //Bug fix - unless the textarea is nested within its label, in which case insert editor before label.
+    if (textarea.parentNode.nodeName.toLowerCase()=='label') {
+        textarea.parentNode.parentNode.insertBefore(htmlarea,textarea.parentNode);
+    }
+    else {
+        textarea.parentNode.insertBefore(htmlarea, textarea);
+    }
 
     if (textarea.form) {
         // we have a form, on submit get the HTMLArea content and