Skip to content

Instantly share code, notes, and snippets.

@petdance
Last active August 29, 2015 14:04
Show Gist options
  • Save petdance/1ae6ef0a24ee72f8434b to your computer and use it in GitHub Desktop.
Save petdance/1ae6ef0a24ee72f8434b to your computer and use it in GitHub Desktop.
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