mirror of
https://github.com/jquery/jquery.git
synced 2024-12-09 08:04:24 +00:00
Event: HTML5 drop events inherit from MouseEvent
Fixes gh-2009 Ref gh-1925
This commit is contained in:
parent
74ae544483
commit
d7e5fcee51
@ -14,7 +14,7 @@ define([
|
|||||||
|
|
||||||
var
|
var
|
||||||
rkeyEvent = /^key/,
|
rkeyEvent = /^key/,
|
||||||
rmouseEvent = /^(?:mouse|pointer|contextmenu|drag)|click/,
|
rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,
|
||||||
rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
|
rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
|
||||||
rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
|
rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
|
||||||
|
|
||||||
|
@ -2444,18 +2444,25 @@ test("fixHooks extensions", function() {
|
|||||||
jQuery.event.fixHooks.click = saved;
|
jQuery.event.fixHooks.click = saved;
|
||||||
});
|
});
|
||||||
|
|
||||||
test( "drag events copy over mouse related event properties (gh-1925)", function() {
|
test( "drag/drop events copy mouse-related event properties (gh-1925, gh-2009)", function() {
|
||||||
expect( 2 );
|
expect( 4 );
|
||||||
|
|
||||||
var $fixture = jQuery( "<div id='drag-fixture'></div>" ).appendTo( "body" );
|
var $fixture = jQuery( "<div id='drag-fixture'></div>" ).appendTo( "body" );
|
||||||
|
|
||||||
$fixture.on( "dragmove", function( evt ) {
|
$fixture.on( "dragmove", function( evt ) {
|
||||||
ok( "pageX" in evt, "checking for pageX property" );
|
ok( "pageX" in evt, "checking for pageX property on dragmove" );
|
||||||
ok( "pageY" in evt, "checking for pageY property" );
|
ok( "pageY" in evt, "checking for pageY property on dragmove" );
|
||||||
|
});
|
||||||
|
fireNative( $fixture[ 0 ], "dragmove" );
|
||||||
|
|
||||||
|
$fixture.on( "drop", function( evt ) {
|
||||||
|
ok( "pageX" in evt, "checking for pageX property on drop" );
|
||||||
|
ok( "pageY" in evt, "checking for pageY property on drop" );
|
||||||
});
|
});
|
||||||
|
|
||||||
fireNative( $fixture[ 0 ], "dragmove" );
|
fireNative( $fixture[ 0 ], "drop" );
|
||||||
$fixture.unbind( "dragmove" ).remove();
|
|
||||||
|
$fixture.unbind( "dragmove drop" ).remove();
|
||||||
});
|
});
|
||||||
|
|
||||||
test( "focusin using non-element targets", function() {
|
test( "focusin using non-element targets", function() {
|
||||||
|
Loading…
Reference in New Issue
Block a user