From 8ec78bc2085e40978515fd24ab4f89bb80a097e0 Mon Sep 17 00:00:00 2001 From: nightwing Date: Wed, 6 Feb 2013 22:05:09 +0400 Subject: [PATCH] fix #360 ext/textarea innerHTML bug --- lib/ace/ext/textarea.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/lib/ace/ext/textarea.js b/lib/ace/ext/textarea.js index fe5066b0..6b10063a 100644 --- a/lib/ace/ext/textarea.js +++ b/lib/ace/ext/textarea.js @@ -73,7 +73,7 @@ function applyStyles(elm, styles) { } function setupContainer(element, getValue) { - if (element.type != 'textarea') { + if (element.type != 'textarea') { throw "Textarea required!"; } @@ -132,11 +132,7 @@ function setupContainer(element, getValue) { resizeEvent(); // Insert the div container after the element. - if (element.nextSibling) { - parentNode.insertBefore(container, element.nextSibling); - } else { - parentNode.appendChild(container); - } + parentNode.insertBefore(container, element.nextSibling); // Override the forms onsubmit function. Set the innerHTML and value // of the textarea before submitting. @@ -145,7 +141,6 @@ function setupContainer(element, getValue) { var oldSumit = parentNode.onsubmit; // Override the onsubmit function of the form. parentNode.onsubmit = function(evt) { - element.innerHTML = getValue(); element.value = getValue(); // If there is a onsubmit function already, then call // it with the current context and pass the event.