Add originating widget to event objects

optimising-macrocalls
jeremy@jermolene.com 2020-05-09 15:53:38 +01:00
rodzic 81f07cdf85
commit 33d973fb91
1 zmienionych plików z 1 dodań i 0 usunięć

Wyświetl plik

@ -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) {