diff options
author | Wu Cheng-Han | 2016-12-07 01:34:42 +0800 |
---|---|---|
committer | Wu Cheng-Han | 2016-12-07 01:34:42 +0800 |
commit | dd284a7bd0f449b9f220ad46b5cca0f064a56ffc (patch) | |
tree | d966be63886c5f5c5b1f5044f80e3b360b7ee901 /public/js | |
parent | bbaf697687d9d06b2386502df069f806b0097338 (diff) |
Fix textcomplete up side down option not set properly
Diffstat (limited to 'public/js')
-rw-r--r-- | public/js/index.js | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/public/js/index.js b/public/js/index.js index a2e0400e..96580fe3 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -3651,9 +3651,6 @@ function reverseSortCursorMenu(dropdown) { return items; } -var lastUpSideDown = false; -var upSideDown = false; - var checkCursorMenu = _.throttle(checkCursorMenuInner, cursorMenuThrottle); function checkCursorMenuInner() { @@ -3692,6 +3689,8 @@ function checkCursorMenuInner() { // set offset var offsetLeft = 0; var offsetTop = defaultTextHeight; + // set up side down + var lastUpSideDown = upSideDown = false; // only do when have width and height if (width > 0 && height > 0) { // make element right bound not larger than doc width @@ -3703,12 +3702,11 @@ function checkCursorMenuInner() { offsetTop = -(height + menuBottomMargin); // reverse sort menu because upSideDown dropdown.html(reverseSortCursorMenu(dropdown)); - lastUpSideDown = upSideDown; upSideDown = true; - } else { - lastUpSideDown = upSideDown; - upSideDown = false; } + var textCompleteDropdown = $(editor.getInputField()).data('textComplete').dropdown; + lastUpSideDown = textCompleteDropdown.upSideDown; + textCompleteDropdown.upSideDown = upSideDown; } // make menu scroll top only if upSideDown changed if (upSideDown !== lastUpSideDown) |