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
52c6739c
Commit
52c6739c
authored
Jul 08, 2007
by
John Resig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed selected/checked/disabled, added .style support, added .elements.
parent
e155a6ae
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
4 deletions
+26
-4
env.js
build/runtest/env.js
+26
-4
No files found.
build/runtest/env.js
View file @
52c6739c
...
...
@@ -203,6 +203,17 @@ var window = this;
window
.
DOMElement
=
function
(
elem
){
this
.
_dom
=
elem
;
this
.
style
=
{};
// Load CSS info
var
styles
=
(
new
String
(
this
.
getAttribute
(
"style"
)
||
""
))
.
split
(
/
\s
*;
\s
*/
);
for
(
var
i
=
0
;
i
<
styles
.
length
;
i
++
)
{
var
style
=
styles
[
i
].
split
(
/
\s
*:
\s
*/
);
if
(
style
.
length
==
2
)
this
.
style
[
style
[
0
]
]
=
style
[
1
];
}
};
DOMElement
.
prototype
=
extend
(
new
DOMNode
(),
{
...
...
@@ -281,13 +292,22 @@ var window = this;
offsetHeight
:
0
,
offsetWidth
:
0
,
get
disabled
()
{
return
!!
this
.
getAttribute
(
"disabled"
);
},
get
disabled
()
{
var
val
=
this
.
getAttribute
(
"disabled"
);
return
val
!=
"false"
&&
!!
val
;
},
set
disabled
(
val
)
{
return
this
.
setAttribute
(
"disabled"
,
val
);
},
get
checked
()
{
return
!!
this
.
getAttribute
(
"checked"
);
},
get
checked
()
{
var
val
=
this
.
getAttribute
(
"checked"
);
return
val
!=
"false"
&&
!!
val
;
},
set
checked
(
val
)
{
return
this
.
setAttribute
(
"checked"
,
val
);
},
get
selected
()
{
return
!!
this
.
getAttribute
(
"selected"
);
},
get
selected
()
{
var
val
=
this
.
getAttribute
(
"selected"
);
return
val
!=
"false"
&&
!!
val
;
},
set
selected
(
val
)
{
return
this
.
setAttribute
(
"selected"
,
val
);
},
get
className
()
{
return
this
.
getAttribute
(
"class"
)
||
""
;
},
...
...
@@ -343,7 +363,9 @@ var window = this;
submit
:
function
(){},
focus
:
function
(){},
blur
:
function
(){},
elements
:
[]
get
elements
(){
return
this
.
getElementsByTagName
(
"*"
);
}
});
// Helper method for extending one object with another
...
...
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