onchange event isn't triggered when quoting, fix that.

This commit is contained in:
Nicolas Stepien 2012-01-17 00:57:48 +01:00
parent 76b84c9a14
commit 1e7d22223e
2 changed files with 5 additions and 1 deletions

View File

@ -1261,7 +1261,8 @@
caretPos = ta.selectionStart;
ta.value = ta.value.slice(0, caretPos) + text + ta.value.slice(ta.selectionEnd, ta.value.length);
ta.focus();
return ta.selectionEnd = ta.selectionStart = caretPos + text.length;
ta.selectionEnd = ta.selectionStart = caretPos + text.length;
return qr.selected.com = ta.value;
},
fileDrop: function(e) {
if (/TEXTAREA|INPUT/.test(e.target.nodeName)) return;

View File

@ -931,6 +931,9 @@ qr =
#move the caret to the end of the new quote
ta.selectionEnd = ta.selectionStart = caretPos + text.length
# onchange event isn't triggered, save value
qr.selected.com = ta.value
fileDrop: (e) ->
return if /TEXTAREA|INPUT/.test e.target.nodeName
e.preventDefault()