Skip to content

Commit

Permalink
Draggable: Skip window bubbling test in IE 8
Browse files Browse the repository at this point in the history
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
  • Loading branch information
scottgonzalez committed Oct 27, 2015
1 parent 81a0029 commit 33398fa
Showing 1 changed file with 20 additions and 14 deletions.
34 changes: 20 additions & 14 deletions tests/unit/draggable/core.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -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" ); assert.hasClasses( child, "ui-draggable-handle", "child retains class name on destroy" );
} ); } );


test( "does not stop propagation to window", function( assert ) { // Support: IE 8 only
expect( 1 ); // IE 8 implements DOM Level 2 Events which only has events bubble up to the document.
var element = $( "#draggable1" ).draggable(); // We skip this test since it would be impossible for it to pass in such an environment.

QUnit[ document.documentMode === 8 ? "skip" : "test" ](
var handler = function() { "does not stop propagation to window",
assert.ok( true, "mouseup propagates to window" ); function( assert ) {
}; expect( 1 );
$( window ).on( "mouseup", handler ); var element = $( "#draggable1" ).draggable();

var handler = function() {
assert.ok( true, "mouseup propagates to window" );
};
$( window ).on( "mouseup", handler );


element.simulate( "drag", { element.simulate( "drag", {
dx: 10, dx: 10,
dy: 10 dy: 10
} ); } );


$( window ).off( "mouseup", handler ); $( window ).off( "mouseup", handler );
} ); }
);


} ); } );

0 comments on commit 33398fa

Please sign in to comment.