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 );
+
+ element.simulate( "drag", {
+ dx: 10,
+ dy: 10
+ } );
+
+ $( window ).off( "mouseup", handler );
+} );
+
} );
if ( !noPropagation ) {
var ui = this._uiHash();
if ( this._trigger( "drag", event, ui ) === false ) {
- this._mouseUp( {} );
+ this._mouseUp( new $.Event( "mouseup", event ) );
return false;
}
this.position = ui.position;
cancel: function() {
if ( this.helper.is( ".ui-draggable-dragging" ) ) {
- this._mouseUp( {} );
+ this._mouseUp( new $.Event( "mouseup", { target: this.element[ 0 ] } ) );
} else {
this._clear();
}