diff options
author | Scott González <scott.gonzalez@gmail.com> | 2015-10-26 15:10:43 -0400 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2015-10-27 11:12:14 -0400 |
commit | 33398fa4f1ee33473cc6c190b2b1d38c11b8c38b (patch) | |
tree | 346720b42903ad42ddb9e51c69fbab30f201f690 /tests | |
parent | 81a002991e1d307b460af60162f0b058e7b74750 (diff) | |
download | jquery-ui-33398fa4f1ee33473cc6c190b2b1d38c11b8c38b.tar.gz jquery-ui-33398fa4f1ee33473cc6c190b2b1d38c11b8c38b.zip |
Draggable: Skip window bubbling test in IE 8
IE 8 implements DOM Level 2 Events which only has events propagate
up to the document, not the window.
Ref #10818
Ref gh-1621
Closes gh-1627
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/draggable/core.js | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/tests/unit/draggable/core.js b/tests/unit/draggable/core.js index 9efe9d3f1..61d8503ea 100644 --- a/tests/unit/draggable/core.js +++ b/tests/unit/draggable/core.js @@ -345,21 +345,27 @@ test( "ui-draggable-handle managed correctly in nested draggables", function( as assert.hasClasses( child, "ui-draggable-handle", "child retains class name on destroy" ); } ); -test( "does not stop propagation to window", function( assert ) { - expect( 1 ); - var element = $( "#draggable1" ).draggable(); - - var handler = function() { - assert.ok( true, "mouseup propagates to window" ); - }; - $( window ).on( "mouseup", handler ); +// Support: IE 8 only +// IE 8 implements DOM Level 2 Events which only has events bubble up to the document. +// We skip this test since it would be impossible for it to pass in such an environment. +QUnit[ document.documentMode === 8 ? "skip" : "test" ]( + "does not stop propagation to window", + function( assert ) { + expect( 1 ); + var element = $( "#draggable1" ).draggable(); + + var handler = function() { + assert.ok( true, "mouseup propagates to window" ); + }; + $( window ).on( "mouseup", handler ); - element.simulate( "drag", { - dx: 10, - dy: 10 - } ); + element.simulate( "drag", { + dx: 10, + dy: 10 + } ); - $( window ).off( "mouseup", handler ); -} ); + $( window ).off( "mouseup", handler ); + } +); } ); |