File tree Expand file tree Collapse file tree
vendor/jquery-textcomplete Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3651,9 +3651,6 @@ function reverseSortCursorMenu(dropdown) {
36513651 return items ;
36523652}
36533653
3654- var lastUpSideDown = false ;
3655- var upSideDown = false ;
3656-
36573654var checkCursorMenu = _ . throttle ( checkCursorMenuInner , cursorMenuThrottle ) ;
36583655
36593656function checkCursorMenuInner ( ) {
@@ -3692,6 +3689,8 @@ function checkCursorMenuInner() {
36923689 // set offset
36933690 var offsetLeft = 0 ;
36943691 var offsetTop = defaultTextHeight ;
3692+ // set up side down
3693+ var lastUpSideDown = upSideDown = false ;
36953694 // only do when have width and height
36963695 if ( width > 0 && height > 0 ) {
36973696 // make element right bound not larger than doc width
@@ -3703,12 +3702,11 @@ function checkCursorMenuInner() {
37033702 offsetTop = - ( height + menuBottomMargin ) ;
37043703 // reverse sort menu because upSideDown
37053704 dropdown . html ( reverseSortCursorMenu ( dropdown ) ) ;
3706- lastUpSideDown = upSideDown ;
37073705 upSideDown = true ;
3708- } else {
3709- lastUpSideDown = upSideDown ;
3710- upSideDown = false ;
37113706 }
3707+ var textCompleteDropdown = $ ( editor . getInputField ( ) ) . data ( 'textComplete' ) . dropdown ;
3708+ lastUpSideDown = textCompleteDropdown . upSideDown ;
3709+ textCompleteDropdown . upSideDown = upSideDown ;
37123710 }
37133711 // make menu scroll top only if upSideDown changed
37143712 if ( upSideDown !== lastUpSideDown )
Original file line number Diff line number Diff line change @@ -167,6 +167,7 @@ if (typeof jQuery === 'undefined') {
167167 var element = this . $el . get ( 0 ) ;
168168 // Initialize view objects.
169169 this . dropdown = new $ . fn . textcomplete . Dropdown ( element , this , this . option ) ;
170+ this . dropdown . upSideDown = false ;
170171 var Adapter , viewName ;
171172 if ( this . option . adapter ) {
172173 Adapter = this . option . adapter ;
@@ -556,13 +557,13 @@ if (typeof jQuery === 'undefined') {
556557 if ( ! this . shown ) { return ; }
557558 if ( this . isUp ( e ) ) {
558559 e . preventDefault ( ) ;
559- if ( typeof upSideDown != 'undefined' && upSideDown )
560+ if ( this . upSideDown )
560561 this . _down ( ) ;
561562 else
562563 this . _up ( ) ;
563564 } else if ( this . isDown ( e ) ) {
564565 e . preventDefault ( ) ;
565- if ( typeof upSideDown != 'undefined' && upSideDown )
566+ if ( this . upSideDown )
566567 this . _up ( ) ;
567568 else
568569 this . _down ( ) ;
You can’t perform that action at this time.
0 commit comments