diff options
author | NAGOYA, Yoshihiko <nagoya@lepidum.co.jp> | 2012-10-11 23:39:01 +0900 |
---|---|---|
committer | NAGOYA, Yoshihiko <nagoya@lepidum.co.jp> | 2012-10-12 01:12:15 +0900 |
commit | 957a0aa873f2df13483a9b17589c064cc229a80a (patch) | |
tree | 90af20d60631cf45dcb6c35e3cde69512f5b042d /src/static/js/ace2_inner.js | |
parent | d7ec050f342a717146f181dac76fc1e2b0cada59 (diff) | |
download | etherpad-lite-957a0aa873f2df13483a9b17589c064cc229a80a.zip |
fix Pita/etherpad-lite #1032
refact inInternationalComposition
Diffstat (limited to 'src/static/js/ace2_inner.js')
-rw-r--r-- | src/static/js/ace2_inner.js | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js index 652a3d25..2e56b950 100644 --- a/src/static/js/ace2_inner.js +++ b/src/static/js/ace2_inner.js @@ -1173,7 +1173,7 @@ function Ace2Inner(){ //if (! top.BEFORE) top.BEFORE = []; //top.BEFORE.push(magicdom.root.dom.innerHTML); //if (! isEditable) return; // and don't reschedule - if (window.parent.parent.inInternationalComposition) + if (inInternationalComposition) { // don't do idle input incorporation during international input composition idleWorkTimer.atLeast(500); @@ -3729,7 +3729,7 @@ function Ace2Inner(){ thisKeyDoesntTriggerNormalize = true; } - if ((!specialHandled) && (!thisKeyDoesntTriggerNormalize) && (!window.parent.parent.inInternationalComposition)) + if ((!specialHandled) && (!thisKeyDoesntTriggerNormalize) && (!inInternationalComposition)) { if (type != "keyup" || !incorpIfQuick()) { @@ -4589,9 +4589,24 @@ function Ace2Inner(){ } } + + var inInternationalComposition = false; function handleCompositionEvent(evt) { - window.parent.parent.handleCompositionEvent(evt); + // international input events, fired in FF3, at least; allow e.g. Japanese input + if (evt.type == "compositionstart") + { + inInternationalComposition = true; + } + else if (evt.type == "compositionend") + { + inInternationalComposition = false; + } + } + + editorInfo.ace_getInInternationalComposition = function () + { + return inInternationalComposition; } function bindTheEventHandlers() |