From 667666fbc6c82467ff7bd3aee247fbfbd554a272 Mon Sep 17 00:00:00 2001 From: Richard Worth Date: Thu, 5 Jun 2008 12:11:30 +0000 Subject: [PATCH] set a more reasonable default for relatedTarget: undefined for IE, HEMLHtmlElement for other browsers --- ui/tests/jquery.simulate.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/tests/jquery.simulate.js b/ui/tests/jquery.simulate.js index b425d4e6a..4102d583f 100644 --- a/ui/tests/jquery.simulate.js +++ b/ui/tests/jquery.simulate.js @@ -51,7 +51,7 @@ $.extend($.simulate.prototype, { bubbles: true, cancelable: (type != "mousemove"), view: window, detail: 0, screenX: 0, screenY: 0, clientX: options.x || 0, clientY: options.y || 0, ctrlKey: false, altKey: false, shiftKey: false, metaKey: false, - button: 0, relatedTarget: null + button: 0, relatedTarget: undefined }, options); var relatedTarget = $(e.relatedTarget)[0]; @@ -61,7 +61,7 @@ $.extend($.simulate.prototype, { evt.initMouseEvent(type, e.bubbles, e.cancelable, e.view, e.detail, e.screenX, e.screenY, e.clientX, e.clientY, e.ctrlKey, e.altKey, e.shiftKey, e.metaKey, - e.button, relatedTarget); + e.button, e.relatedTarget || document.body.parentNode); } else if (document.createEventObject) { evt = document.createEventObject(); $.extend(evt, e); -- 2.39.5