Last active
August 29, 2015 14:04
-
-
Save petdance/1ae6ef0a24ee72f8434b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
close: function( event ) { | |
clearTimeout( this.closing ); | |
if ( this.menu.element.is(":visible") ) { | |
this.menu.element.hide(); | |
this.menu.deactivate(); | |
this._trigger( "close", event ); | |
} | |
}, | |
_suggest: function( items ) { | |
var ul = this.menu.element | |
.empty() | |
.zIndex( this.element.zIndex() + 1 ); | |
this._renderMenu( ul, items ); | |
// TODO refresh should check if the active item is still in the dom, removing the need for a manual deactivate | |
this.menu.deactivate(); | |
this.menu.refresh(); | |
// size and position menu | |
ul.show(); | |
this._resizeMenu(); | |
ul.position( $.extend({ | |
of: this.element | |
}, this.options.position )); | |
if ( this.options.autoFocus ) { | |
this.menu.next( new $.Event("mouseover") ); | |
} | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment