fix #360 ext/textarea innerHTML bug

This commit is contained in:
nightwing 2013-02-06 22:05:09 +04:00
commit 8ec78bc208

View file

@ -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.