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
18b1cf29
Commit
18b1cf29
authored
May 08, 2011
by
timmywil
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove value check from formHook; other elements can use value hook
parent
90f37aaf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
4 deletions
+3
-4
attributes.js
src/attributes.js
+0
-3
attributes.js
test/unit/attributes.js
+3
-1
No files found.
src/attributes.js
View file @
18b1cf29
...
@@ -495,9 +495,6 @@ if ( !jQuery.support.getSetAttribute ) {
...
@@ -495,9 +495,6 @@ if ( !jQuery.support.getSetAttribute ) {
formHook
=
jQuery
.
attrHooks
.
name
=
jQuery
.
attrHooks
.
value
=
jQuery
.
valHooks
.
button
=
{
formHook
=
jQuery
.
attrHooks
.
name
=
jQuery
.
attrHooks
.
value
=
jQuery
.
valHooks
.
button
=
{
get
:
function
(
elem
,
name
)
{
get
:
function
(
elem
,
name
)
{
var
ret
;
var
ret
;
if
(
name
===
"value"
&&
!
jQuery
.
nodeName
(
elem
,
"button"
)
)
{
return
elem
.
getAttribute
(
name
);
}
ret
=
elem
.
getAttributeNode
(
name
);
ret
=
elem
.
getAttributeNode
(
name
);
// Return undefined if nodeValue is empty string
// Return undefined if nodeValue is empty string
return
ret
&&
ret
.
nodeValue
!==
""
?
return
ret
&&
ret
.
nodeValue
!==
""
?
...
...
test/unit/attributes.js
View file @
18b1cf29
...
@@ -144,7 +144,7 @@ test("attr(Hash)", function() {
...
@@ -144,7 +144,7 @@ test("attr(Hash)", function() {
});
});
test
(
"attr(String, Object)"
,
function
()
{
test
(
"attr(String, Object)"
,
function
()
{
expect
(
5
8
);
expect
(
5
9
);
var
div
=
jQuery
(
"div"
).
attr
(
"foo"
,
"bar"
),
var
div
=
jQuery
(
"div"
).
attr
(
"foo"
,
"bar"
),
fail
=
false
;
fail
=
false
;
...
@@ -244,6 +244,8 @@ test("attr(String, Object)", function() {
...
@@ -244,6 +244,8 @@ test("attr(String, Object)", function() {
table
.
attr
(
"cellspacing"
,
"2"
);
table
.
attr
(
"cellspacing"
,
"2"
);
equals
(
table
[
0
].
cellSpacing
,
"2"
,
"Check cellspacing is correctly set"
);
equals
(
table
[
0
].
cellSpacing
,
"2"
,
"Check cellspacing is correctly set"
);
equals
(
jQuery
(
"#area1"
).
attr
(
"value"
),
undefined
,
"Value attribute retrieved correctly on textarea."
);
// for #1070
// for #1070
jQuery
(
"#name"
).
attr
(
"someAttr"
,
"0"
);
jQuery
(
"#name"
).
attr
(
"someAttr"
,
"0"
);
equals
(
jQuery
(
"#name"
).
attr
(
"someAttr"
),
"0"
,
"Set attribute to a string of
\"
0
\"
"
);
equals
(
jQuery
(
"#name"
).
attr
(
"someAttr"
),
"0"
,
"Set attribute to a string of
\"
0
\"
"
);
...
...
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