Skip to content

Instantly share code, notes, and snippets.

@sofish
Created April 6, 2012 13:51
Show Gist options
  • Select an option

  • Save sofish/2319950 to your computer and use it in GitHub Desktop.

Select an option

Save sofish/2319950 to your computer and use it in GitHub Desktop.
select: function () {
var val = this.$menu.find('.active').attr('data-value')
this.$element.val(val)
this.$element.change();
// 考拉:添加这行
this.$element.trigger('selected');
return this.hide()
}
其后用 `on` 来搞她:
TypeaheadInputElement.on('selected', function(){
// 选择做点什么
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment