kopia lustrzana https://github.com/miklobit/TiddlyWiki5
Add support for widget event listeners to be specified as functions
rodzic
ce1fb300f8
commit
48dbacc88a
|
@ -318,6 +318,11 @@ Widget.prototype.addEventListener = function(type,handler) {
|
||||||
this.eventListeners[type] = function(event) {
|
this.eventListeners[type] = function(event) {
|
||||||
return self[handler].call(self,event);
|
return self[handler].call(self,event);
|
||||||
};
|
};
|
||||||
|
} else { // The handler is a function
|
||||||
|
this.eventListeners[type] = function(event) {
|
||||||
|
return handler.call(self,event);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue