jsdoc handleAnyTextareaChanges

This commit is contained in:
Daniel Imms
2016-07-13 20:52:55 -07:00
parent 0a7c1bfd98
commit ac8db6e8ec
+7 -2
View File
@@ -239,12 +239,17 @@
}
}
/**
* Apply any changes made to the textarea after the current event chain is allowed to complete.
* This should be called when not currently composing but a keydown event with the "composition
* character" (229) is triggered, in order to allow non-composition text to be entered when an
* IME is active.
*/
CompositionHelper.prototype.handleAnyTextareaChanges = function() {
var oldValue = this.textarea.value;
var self = this;
setTimeout(function() {
// Ensure no composition has started since the timeout
// Ignore if a composition has started since the timeout
if (!self.isComposing) {
var newValue = self.textarea.value;
var diff = newValue.replace(oldValue, '');