Improve key recognition on Callbacks
This commit is contained in:
parent
b80989fe30
commit
b78bcc2488
@ -3121,8 +3121,7 @@
|
|||||||
name = _arg.name, cb = _arg.cb;
|
name = _arg.name, cb = _arg.cb;
|
||||||
if (this[name]) {
|
if (this[name]) {
|
||||||
this.connect(name);
|
this.connect(name);
|
||||||
}
|
} else {
|
||||||
if (!this[name]) {
|
|
||||||
this.keys.push(name);
|
this.keys.push(name);
|
||||||
}
|
}
|
||||||
return this[name] = cb;
|
return this[name] = cb;
|
||||||
|
|||||||
@ -3147,8 +3147,7 @@
|
|||||||
name = _arg.name, cb = _arg.cb;
|
name = _arg.name, cb = _arg.cb;
|
||||||
if (this[name]) {
|
if (this[name]) {
|
||||||
this.connect(name);
|
this.connect(name);
|
||||||
}
|
} else {
|
||||||
if (!this[name]) {
|
|
||||||
this.keys.push(name);
|
this.keys.push(name);
|
||||||
}
|
}
|
||||||
return this[name] = cb;
|
return this[name] = cb;
|
||||||
|
|||||||
@ -3,8 +3,10 @@ class Callbacks
|
|||||||
@keys = []
|
@keys = []
|
||||||
|
|
||||||
push: ({name, cb}) ->
|
push: ({name, cb}) ->
|
||||||
@connect name if @[name]
|
if @[name]
|
||||||
@keys.push name unless @[name]
|
@connect name
|
||||||
|
else
|
||||||
|
@keys.push name
|
||||||
@[name] = cb
|
@[name] = cb
|
||||||
|
|
||||||
connect: (name) -> delete @[name].disconnected if @[name].disconnected
|
connect: (name) -> delete @[name].disconnected if @[name].disconnected
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user