]> source.dussan.org Git - jquery-ui.git/commitdiff
$.widget: Fixed #3965: Copy properties from original event on to new event in _trigger.
authorScott González <scott.gonzalez@gmail.com>
Wed, 28 Jan 2009 03:46:35 +0000 (03:46 +0000)
committerScott González <scott.gonzalez@gmail.com>
Wed, 28 Jan 2009 03:46:35 +0000 (03:46 +0000)
ui/ui.core.js

index a6e76436d3a9b2e95fbcdf95150d402b18a3b6ca..547821e34ea924ba6521c5af852a58f0a626c67a 100644 (file)
@@ -363,6 +363,14 @@ $.widget.prototype = {
                event = $.Event(event);
                event.type = eventName;
 
+               // copy original event properties over to the new event
+               // this would happen if we could call $.event.fix instead of $.Event
+               // but we don't have a way to force an event to be fixed multiple times
+               for (var i = $.event.props.length, prop; i;) {
+                       prop = $.event.props[--i];
+                       event[prop] = event.originalEvent[prop];
+               }
+
                this.element.trigger(event, data);
 
                return !($.isFunction(callback) && callback.call(this.element[0], event, data) === false