]> source.dussan.org Git - jquery-ui.git/commitdiff
set a more reasonable default for relatedTarget: undefined for IE, HEMLHtmlElement...
authorRichard Worth <rdworth@gmail.com>
Thu, 5 Jun 2008 12:11:30 +0000 (12:11 +0000)
committerRichard Worth <rdworth@gmail.com>
Thu, 5 Jun 2008 12:11:30 +0000 (12:11 +0000)
ui/tests/jquery.simulate.js

index b425d4e6a6cdfe70f32381c2ef98f91eddf6f764..4102d583fab72b6166cc9d1e55dd3b73b78589e4 100644 (file)
@@ -51,7 +51,7 @@ $.extend($.simulate.prototype, {
                        bubbles: true, cancelable: (type != "mousemove"), view: window, detail: 0,\r
                        screenX: 0, screenY: 0, clientX: options.x || 0, clientY: options.y || 0,\r
                        ctrlKey: false, altKey: false, shiftKey: false, metaKey: false,\r
-                       button: 0, relatedTarget: null\r
+                       button: 0, relatedTarget: undefined\r
                }, options);\r
                \r
                var relatedTarget = $(e.relatedTarget)[0];\r
@@ -61,7 +61,7 @@ $.extend($.simulate.prototype, {
                        evt.initMouseEvent(type, e.bubbles, e.cancelable, e.view, e.detail,\r
                                e.screenX, e.screenY, e.clientX, e.clientY,\r
                                e.ctrlKey, e.altKey, e.shiftKey, e.metaKey,\r
-                               e.button, relatedTarget);\r
+                               e.button, e.relatedTarget || document.body.parentNode);\r
                } else if (document.createEventObject) {\r
                        evt = document.createEventObject();\r
                        $.extend(evt, e);\r