1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-24 22:33:16 +00:00

Add originating widget to event objects

This commit is contained in:
jeremy@jermolene.com 2020-05-09 15:53:38 +01:00
parent 81f07cdf85
commit 33d973fb91

View File

@ -421,6 +421,7 @@ Widget.prototype.addEventListener = function(type,handler) {
Dispatch an event to a widget. If the widget doesn't handle the event then it is also dispatched to the parent widget
*/
Widget.prototype.dispatchEvent = function(event) {
event.widget = event.widget || this;
// Dispatch the event if this widget handles it
var listener = this.eventListeners[event.type];
if(listener) {