summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLuiza Pagliari <lpagliari@gmail.com>2015-10-27 07:44:51 -0200
committerLuiza Pagliari <lpagliari@gmail.com>2015-10-27 07:44:51 -0200
commitc551fe4c1eee7cc7a5c595f222190aac66fe6b78 (patch)
treeb457e8c14f8ca0ea79520197bd5e9854405af9e4 /src
parent6c68396ed59415b2be30e7dffe659bf0f0d01909 (diff)
downloadetherpad-lite-c551fe4c1eee7cc7a5c595f222190aac66fe6b78.zip
Fix logic to check if any hook handled ACE key event. Fix #2818
Instead of checking if only the first hook had returned true, we check all hooks.
Diffstat (limited to 'src')
-rw-r--r--src/static/js/ace2_inner.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js
index d912dfb1..d746fc68 100644
--- a/src/static/js/ace2_inner.js
+++ b/src/static/js/ace2_inner.js
@@ -3715,7 +3715,12 @@ function Ace2Inner(){
documentAttributeManager: documentAttributeManager,
evt:evt
});
- specialHandled = (specialHandledInHook&&specialHandledInHook.length>0)?specialHandledInHook[0]:specialHandled;
+
+ // if any hook returned true, set specialHandled with true
+ if (specialHandledInHook) {
+ specialHandled = _.contains(specialHandledInHook, true);
+ }
+
if ((!specialHandled) && altKey && isTypeForSpecialKey && keyCode == 120){
// Alt F9 focuses on the File Menu and/or editbar.
// Note that while most editors use Alt F10 this is not desirable