aboutsummaryrefslogtreecommitdiffstats
path: root/tests/jquery.simulate.js
diff options
context:
space:
mode:
Diffstat (limited to 'tests/jquery.simulate.js')
-rw-r--r--tests/jquery.simulate.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/jquery.simulate.js b/tests/jquery.simulate.js
index 6e2f3ba8e..0a0c42487 100644
--- a/tests/jquery.simulate.js
+++ b/tests/jquery.simulate.js
@@ -316,8 +316,12 @@ $.extend( $.simulate.prototype, {
this.simulateEvent( document, "mousemove", coord );
}
- this.simulateEvent( target, "mouseup", coord );
- this.simulateEvent( target, "click", coord );
+ if ( $.contains( document, target ) ) {
+ this.simulateEvent( target, "mouseup", coord );
+ this.simulateEvent( target, "click", coord );
+ } else {
+ this.simulateEvent( document, "mouseup", coord );
+ }
}
});