-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '68-trigger-custom-events' of git://github.com/jharding/…
…typeahead.js into integration-0.9.0 Conflicts: src/dataset.js src/dropdown_view.js test/dropdown_view_spec.js test/playground.html
- Loading branch information
Showing
10 changed files
with
240 additions
and
114 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* typeahead.js | ||
* https://github.com/twitter/typeahead | ||
* Copyright 2013 Twitter, Inc. and other contributors; Licensed MIT | ||
*/ | ||
|
||
var EventBus = (function() { | ||
var namespace = 'typeahead:'; | ||
|
||
function EventBus(o) { | ||
if (!o || !o.el) { | ||
$.error('EventBus initialized without el'); | ||
} | ||
|
||
this.$el = $(o.el); | ||
} | ||
|
||
utils.mixin(EventBus.prototype, { | ||
// public methods | ||
// -------------- | ||
|
||
trigger: function(type) { | ||
var args = [].slice.call(arguments, 1); | ||
|
||
this.$el.trigger(namespace + type, args); | ||
} | ||
}); | ||
|
||
return EventBus; | ||
})(); |
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
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
Oops, something went wrong.