Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jquery
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
夏彬
jquery
Commits
1d202c6a
Commit
1d202c6a
authored
May 26, 2011
by
timmywil
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move the value attrHook to the main attrHooks object to save bytes
parent
9d4033d6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
20 deletions
+19
-20
attributes.js
src/attributes.js
+19
-20
No files found.
src/attributes.js
View file @
1d202c6a
...
@@ -414,6 +414,25 @@ jQuery.extend({
...
@@ -414,6 +414,25 @@ jQuery.extend({
0
:
0
:
undefined
;
undefined
;
}
}
},
// Use the value property for back compat
// Use the formHook for button elements in IE6/7 (#1954)
value
:
{
get
:
function
(
elem
,
name
)
{
if
(
formHook
&&
jQuery
.
nodeName
(
elem
,
"button"
)
)
{
return
formHook
.
get
(
elem
,
name
);
}
return
name
in
elem
?
elem
.
value
:
null
;
},
set
:
function
(
elem
,
value
,
name
)
{
if
(
formHook
&&
jQuery
.
nodeName
(
elem
,
"button"
)
)
{
return
formHook
.
set
(
elem
,
value
,
name
);
}
// Does not return so that setAttribute is also used
elem
.
value
=
value
;
}
}
}
},
},
...
@@ -497,26 +516,6 @@ boolHook = {
...
@@ -497,26 +516,6 @@ boolHook = {
}
}
};
};
// Use the value property for back compat
// Use the formHook for button elements in IE6/7 (#1954)
jQuery
.
attrHooks
.
value
=
{
get
:
function
(
elem
,
name
)
{
if
(
formHook
&&
jQuery
.
nodeName
(
elem
,
"button"
)
)
{
return
formHook
.
get
(
elem
,
name
);
}
return
name
in
elem
?
elem
.
value
:
null
;
},
set
:
function
(
elem
,
value
,
name
)
{
if
(
formHook
&&
jQuery
.
nodeName
(
elem
,
"button"
)
)
{
return
formHook
.
set
(
elem
,
value
,
name
);
}
// Does not return so that setAttribute is also used
elem
.
value
=
value
;
}
};
// IE6/7 do not support getting/setting some attributes with get/setAttribute
// IE6/7 do not support getting/setting some attributes with get/setAttribute
if
(
!
jQuery
.
support
.
getSetAttribute
)
{
if
(
!
jQuery
.
support
.
getSetAttribute
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment