From f62c4ca4de85d163b41349c3ab34a12516abd226 Mon Sep 17 00:00:00 2001 From: anthonyforth Date: Mon, 30 Apr 2007 13:19:33 +0000 Subject: [PATCH] Fix for bug 9646 --- lib/editor/htmlarea/htmlarea.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 -- 2.39.5