aboutsummaryrefslogtreecommitdiff
path: root/imports/codemirror/lib/util/simple-hint.js
diff options
context:
space:
mode:
authorhwc4872012-05-11 13:52:55 -0700
committerhwc4872012-05-11 13:52:55 -0700
commit137bfc9d4c41cc918d969565bec28a834fe10472 (patch)
treee9fa109fc65218f45e386df48b713ff5858f3d62 /imports/codemirror/lib/util/simple-hint.js
parentd21aaca3d7093b6af968b7f9f764ab54e004f02b (diff)
parent27f4cacb39de1c2e3910748dadc9fc16d0655480 (diff)
downloadninja-137bfc9d4c41cc918d969565bec28a834fe10472.tar.gz
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal into Textures
Conflicts: js/lib/geom/geom-obj.js js/lib/geom/rectangle.js js/tools/TagTool.js
Diffstat (limited to 'imports/codemirror/lib/util/simple-hint.js')
-rw-r--r--imports/codemirror/lib/util/simple-hint.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/imports/codemirror/lib/util/simple-hint.js b/imports/codemirror/lib/util/simple-hint.js
index b38f3892..7decd587 100644
--- a/imports/codemirror/lib/util/simple-hint.js
+++ b/imports/codemirror/lib/util/simple-hint.js
@@ -29,6 +29,10 @@
29 complete.style.left = pos.x + "px"; 29 complete.style.left = pos.x + "px";
30 complete.style.top = pos.yBot + "px"; 30 complete.style.top = pos.yBot + "px";
31 document.body.appendChild(complete); 31 document.body.appendChild(complete);
32 // If we're at the edge of the screen, then we want the menu to appear on the left of the cursor.
33 var winW = window.innerWidth || Math.max(document.body.offsetWidth, document.documentElement.offsetWidth);
34 if(winW - pos.x < sel.clientWidth)
35 complete.style.left = (pos.x - sel.clientWidth) + "px";
32 // Hack to hide the scrollbar. 36 // Hack to hide the scrollbar.
33 if (completions.length <= 10) 37 if (completions.length <= 10)
34 complete.style.width = (sel.clientWidth - 1) + "px"; 38 complete.style.width = (sel.clientWidth - 1) + "px";
@@ -53,6 +57,8 @@
53 else if (code == 27) {CodeMirror.e_stop(event); close(); editor.focus();} 57 else if (code == 27) {CodeMirror.e_stop(event); close(); editor.focus();}
54 else if (code != 38 && code != 40) { 58 else if (code != 38 && code != 40) {
55 close(); editor.focus(); 59 close(); editor.focus();
60 // Pass the event to the CodeMirror instance so that it can handle things like backspace properly.
61 editor.triggerOnKeyDown(event);
56 setTimeout(function(){CodeMirror.simpleHint(editor, getHints);}, 50); 62 setTimeout(function(){CodeMirror.simpleHint(editor, getHints);}, 50);
57 } 63 }
58 }); 64 });