mirror of
https://github.com/jquery/jquery-ui.git
synced 2025-01-07 20:34:24 +00:00
parent
ac81e39237
commit
a1d69208ba
@ -345,4 +345,21 @@ 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 ) {
|
||||||
|
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 );
|
||||||
|
} );
|
||||||
|
|
||||||
} );
|
} );
|
||||||
|
@ -255,7 +255,7 @@ $.widget( "ui.draggable", $.ui.mouse, {
|
|||||||
if ( !noPropagation ) {
|
if ( !noPropagation ) {
|
||||||
var ui = this._uiHash();
|
var ui = this._uiHash();
|
||||||
if ( this._trigger( "drag", event, ui ) === false ) {
|
if ( this._trigger( "drag", event, ui ) === false ) {
|
||||||
this._mouseUp( {} );
|
this._mouseUp( new $.Event( "mouseup", event ) );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
this.position = ui.position;
|
this.position = ui.position;
|
||||||
@ -322,7 +322,7 @@ $.widget( "ui.draggable", $.ui.mouse, {
|
|||||||
cancel: function() {
|
cancel: function() {
|
||||||
|
|
||||||
if ( this.helper.is( ".ui-draggable-dragging" ) ) {
|
if ( this.helper.is( ".ui-draggable-dragging" ) ) {
|
||||||
this._mouseUp( {} );
|
this._mouseUp( new $.Event( "mouseup", { target: this.element[ 0 ] } ) );
|
||||||
} else {
|
} else {
|
||||||
this._clear();
|
this._clear();
|
||||||
}
|
}
|
||||||
|
@ -189,7 +189,7 @@ return $.widget( "ui.mouse", {
|
|||||||
}
|
}
|
||||||
|
|
||||||
mouseHandled = false;
|
mouseHandled = false;
|
||||||
return false;
|
event.preventDefault();
|
||||||
},
|
},
|
||||||
|
|
||||||
_mouseDistanceMet: function( event ) {
|
_mouseDistanceMet: function( event ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user