mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-09-05 12:28:02 +00:00
Add support for widget event listeners to be specified as functions
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user