Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1a5fff4

Browse files
authored
Event: Remove the event.which shim
All supported browsers implement this property by themselves. The shim was onlyneeded for IE <9.Fixesgh-3235Closesgh-4765Refgh-4755
1 parenta1e619b commit1a5fff4

File tree

1 file changed

+2
-32
lines changed

1 file changed

+2
-32
lines changed

‎src/event.js

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@ import nodeName from "./core/nodeName.js";
1111
import"./core/init.js";
1212
import"./selector.js";
1313

14-
var
15-
rkeyEvent=/^key/,
16-
rmouseEvent=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,
17-
rtypenamespace=/^([^.]*)(?:\.(.+)|)/;
14+
varrtypenamespace=/^([^.]*)(?:\.(.+)|)/;
1815

1916
functionreturnTrue(){
2017
returntrue;
@@ -717,34 +714,7 @@ jQuery.each( {
717714
targetTouches:true,
718715
toElement:true,
719716
touches:true,
720-
721-
which:function(event){
722-
varbutton=event.button;
723-
724-
// Add which for key events
725-
if(event.which==null&&rkeyEvent.test(event.type)){
726-
returnevent.charCode!=null ?event.charCode :event.keyCode;
727-
}
728-
729-
// Add which for click: 1 === left; 2 === middle; 3 === right
730-
if(!event.which&&button!==undefined&&rmouseEvent.test(event.type)){
731-
if(button&1){
732-
return1;
733-
}
734-
735-
if(button&2){
736-
return3;
737-
}
738-
739-
if(button&4){
740-
return2;
741-
}
742-
743-
return0;
744-
}
745-
746-
returnevent.which;
747-
}
717+
which:true
748718
},jQuery.event.addProp);
749719

750720
jQuery.each({focus:"focusin",blur:"focusout"},function(type,delegateType){

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp