mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-07-14 00:24:28 +02:00
one event baton in practice, but keyboard is complicated...
This commit is contained in:
parent
0779bdeadb
commit
8e8eb4f4a9
5 changed files with 53 additions and 59 deletions
|
@ -19,15 +19,14 @@ EventBaton.prototype.stealBaton = function(name, func, context) {
|
|||
};
|
||||
|
||||
EventBaton.prototype.trigger = function(name) {
|
||||
// arguments is weird and doesnt do slice right
|
||||
var argsToApply = [];
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
argsToApply.push(arguments[i]);
|
||||
}
|
||||
|
||||
// get the last one
|
||||
var listeners = this.eventMap[name];
|
||||
if (!listeners) {
|
||||
console.warn('no listeners for that event', name);
|
||||
return;
|
||||
}
|
||||
// call the top most listener with context and such
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue