]> source.dussan.org Git - jquery-ui.git/commitdiff
core: check for event.originalEvent before copying
authorRichard Worth <rdworth@gmail.com>
Wed, 28 Jan 2009 09:15:51 +0000 (09:15 +0000)
committerRichard Worth <rdworth@gmail.com>
Wed, 28 Jan 2009 09:15:51 +0000 (09:15 +0000)
ui/ui.core.js

index 547821e34ea924ba6521c5af852a58f0a626c67a..12ee73737bd23a57aeb57c8afa25f9511981a95c 100644 (file)
@@ -366,9 +366,11 @@ $.widget.prototype = {
                // 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];
+               if (event.originalEvent) {
+                       for (var i = $.event.props.length, prop; i;) {
+                               prop = $.event.props[--i];
+                               event[prop] = event.originalEvent[prop];
+                       }
                }
 
                this.element.trigger(event, data);