Run pre-commit on legacy code
This commit is contained in:
parent
fea11ac752
commit
83b7e4162e
323 changed files with 6126 additions and 6462 deletions
|
@ -11,7 +11,7 @@ var publisher = {
|
|||
on: function (type, fn, context) {
|
||||
type = type || 'any';
|
||||
fn = typeof fn === "function" ? fn : context[fn];
|
||||
|
||||
|
||||
if (typeof this.subscribers[type] === "undefined") {
|
||||
this.subscribers[type] = [];
|
||||
}
|
||||
|
@ -31,11 +31,11 @@ var publisher = {
|
|||
subscribers = this.subscribers[pubtype],
|
||||
i,
|
||||
max = subscribers ? subscribers.length : 0;
|
||||
|
||||
|
||||
for (i = 0; i < max; i += 1) {
|
||||
if (action === 'publish') {
|
||||
subscribers[i].fn.call(subscribers[i].context, arg);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (subscribers[i].fn === arg && subscribers[i].context === context) {
|
||||
subscribers.splice(i, 1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue