diff options
author | John Mayhew | 2012-05-07 16:30:19 -0700 |
---|---|---|
committer | John Mayhew | 2012-05-07 16:30:19 -0700 |
commit | db4ba95f50148198759dde503ec1c778184d9dbe (patch) | |
tree | 8b79ad58108af2f17d15abc8cdc33d35229ab20d /imports/codemirror/lib/util/simple-hint.js | |
parent | 843d8ea8ee58a54bcb71d7b28dbf78fae153b491 (diff) | |
parent | 526e423e4a2734c2b139af23911e912452a4443f (diff) | |
download | ninja-db4ba95f50148198759dde503ec1c778184d9dbe.tar.gz |
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal into WorkingBranch
Conflicts:
js/components/layout/tools-list.reel/tools-list.html
js/components/layout/tools-properties.reel/tools-properties.html
js/components/tools-properties/brush-properties.reel/brush-properties.html
js/components/tools-properties/fill-properties.reel/fill-properties.html
js/components/tools-properties/pen-properties.reel/pen-properties.html
js/components/tools-properties/pencil-properties.reel/pencil-properties.html
js/components/tools-properties/selection-properties.reel/selection-properties.html
js/components/tools-properties/shape-properties.reel/shape-properties.html
js/components/tools-properties/tag-properties.reel/tag-properties.html
js/components/tools-properties/text-properties.reel/text-properties.html
Diffstat (limited to 'imports/codemirror/lib/util/simple-hint.js')
-rw-r--r-- | imports/codemirror/lib/util/simple-hint.js | 6 |
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 | }); |