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
2942be78
Commit
2942be78
authored
Apr 22, 2011
by
timmywil
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Combine the support tests for radioValue and appendChecked
parent
16312c6b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
10 deletions
+9
-10
attributes.js
src/attributes.js
+1
-0
support.js
src/support.js
+8
-10
No files found.
src/attributes.js
View file @
2942be78
...
...
@@ -363,6 +363,7 @@ jQuery.extend({
}
else
if
(
!
jQuery
.
support
.
radioValue
&&
value
===
"radio"
&&
jQuery
.
nodeName
(
elem
,
"input"
)
)
{
// Setting the type on a radio button after the value resets the value in IE6-9
// Reset value to it's default in case type is set after value
// This is for element creation
var
val
=
elem
.
getAttribute
(
"value"
);
elem
.
setAttribute
(
"type"
,
value
);
if
(
val
)
{
...
...
src/support.js
View file @
2942be78
...
...
@@ -115,13 +115,15 @@ jQuery.support = (function() {
div
.
cloneNode
(
true
).
fireEvent
(
"onclick"
);
}
// Check if a radio maintains it's value
// after being appended to the DOM
input
=
document
.
createElement
(
"input"
);
input
.
value
=
"t"
;
input
.
setAttribute
(
"type"
,
"radio"
);
support
.
radioValue
=
input
.
value
===
"t"
;
div
.
innerHTML
=
"<input type='radio' name='radiotest' checked='checked'/>"
;
input
.
setAttribute
(
"checked"
,
"checked"
)
;
div
.
appendChild
(
input
);
fragment
=
document
.
createDocumentFragment
();
fragment
.
appendChild
(
div
.
firstChild
);
...
...
@@ -148,6 +150,10 @@ jQuery.support = (function() {
body
.
appendChild
(
div
);
document
.
documentElement
.
appendChild
(
body
);
// Check if a disconnected checkbox will retain its checked
// value of true after appended to the DOM (IE6/7)
support
.
appendChecked
=
input
.
checked
;
support
.
boxModel
=
div
.
offsetWidth
===
2
;
if
(
"zoom"
in
div
.
style
)
{
...
...
@@ -186,14 +192,6 @@ jQuery.support = (function() {
support
.
reliableHiddenOffsets
=
isSupported
&&
(
tds
[
0
].
offsetHeight
===
0
);
div
.
innerHTML
=
""
;
// Check if a disconnected checkbox will retain its checked
// value of true after appended to the DOM
input
=
document
.
createElement
(
"input"
);
input
.
setAttribute
(
"type"
,
"checkbox"
);
input
.
checked
=
true
;
div
.
appendChild
(
input
);
support
.
appendChecked
=
input
.
checked
;
// Check if div with explicit width and no margin-right incorrectly
// gets computed margin-right based on width of container. For more
// info see bug #3333
...
...
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