mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-08-08 06:43:49 +00:00
Add originating widget to event objects
This commit is contained in:
parent
81f07cdf85
commit
33d973fb91
@ -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
|
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) {
|
Widget.prototype.dispatchEvent = function(event) {
|
||||||
|
event.widget = event.widget || this;
|
||||||
// Dispatch the event if this widget handles it
|
// Dispatch the event if this widget handles it
|
||||||
var listener = this.eventListeners[event.type];
|
var listener = this.eventListeners[event.type];
|
||||||
if(listener) {
|
if(listener) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user