mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-01-12 02:10:27 +00:00
Add support for widget event listeners to be specified as functions
This commit is contained in:
parent
ce1fb300f8
commit
48dbacc88a
@ -318,6 +318,11 @@ Widget.prototype.addEventListener = function(type,handler) {
|
||||
this.eventListeners[type] = function(event) {
|
||||
return self[handler].call(self,event);
|
||||
};
|
||||
} else { // The handler is a function
|
||||
this.eventListeners[type] = function(event) {
|
||||
return handler.call(self,event);
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user