From: anthonyforth Date: Mon, 30 Apr 2007 13:19:33 +0000 (+0000) Subject: Fix for bug 9646 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=f62c4ca4de85d163b41349c3ab34a12516abd226;p=moodle.git Fix for bug 9646 --- diff --git a/lib/editor/htmlarea/htmlarea.php b/lib/editor/htmlarea/htmlarea.php index 1ec349e8f8..d0f6fae42f 100644 --- a/lib/editor/htmlarea/htmlarea.php +++ b/lib/editor/htmlarea/htmlarea.php @@ -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