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

Commit9e66fe9

Browse files
authored
Attributes: Don't set the type attr hook at all outside of IE
This removes a needless function call in modern browsers.Closesgh-4587
1 parent437f389 commit9e66fe9

File tree

1 file changed

+18
-17
lines changed

1 file changed

+18
-17
lines changed

‎src/attributes/attr.js

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -64,23 +64,7 @@ jQuery.extend( {
6464
returnret==null ?undefined :ret;
6565
},
6666

67-
attrHooks:{
68-
type:{
69-
set:function(elem,value){
70-
71-
// Support: IE <=11+
72-
// An input loses its value after becoming a radio
73-
if(isIE&&value==="radio"&&nodeName(elem,"input")){
74-
varval=elem.value;
75-
elem.setAttribute("type",value);
76-
if(val){
77-
elem.value=val;
78-
}
79-
returnvalue;
80-
}
81-
}
82-
}
83-
},
67+
attrHooks:{},
8468

8569
removeAttr:function(elem,value){
8670
varname,
@@ -98,6 +82,23 @@ jQuery.extend( {
9882
}
9983
});
10084

85+
// Support: IE <=11+
86+
// An input loses its value after becoming a radio
87+
if(isIE){
88+
jQuery.attrHooks.type={
89+
set:function(elem,value){
90+
if(value==="radio"&&nodeName(elem,"input")){
91+
varval=elem.value;
92+
elem.setAttribute("type",value);
93+
if(val){
94+
elem.value=val;
95+
}
96+
returnvalue;
97+
}
98+
}
99+
};
100+
}
101+
101102
jQuery.each(jQuery.expr.match.bool.source.match(/\w+/g),function(_i,name){
102103
jQuery.attrHooks[name]={
103104
get:function(elem){

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp