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
f75c0627
Commit
f75c0627
authored
Dec 31, 2012
by
Dave Methvin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Restore optSelected hack still needed by IE9/10
parent
747dd8c0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
0 deletions
+18
-0
attributes.js
src/attributes.js
+14
-0
support.js
src/support.js
+4
-0
No files found.
src/attributes.js
View file @
f75c0627
...
...
@@ -478,3 +478,17 @@ jQuery.each([ "radio", "checkbox" ], function() {
}
});
});
// IE9/10 do not see a selected option inside an optgroup unless you access it
// Support: IE9, IE10
if
(
!
jQuery
.
support
.
optSelected
)
{
jQuery
.
propHooks
.
selected
=
jQuery
.
extend
(
jQuery
.
propHooks
.
selected
,
{
get
:
function
(
elem
)
{
var
parent
=
elem
.
parentNode
;
if
(
parent
&&
parent
.
parentNode
)
{
parent
.
parentNode
.
selectedIndex
;
}
return
null
;
}
});
}
src/support.js
View file @
f75c0627
...
...
@@ -47,6 +47,10 @@ jQuery.support = (function() {
// Check the default checkbox/radio value ("" on WebKit; "on" elsewhere)
checkOn
:
!!
input
.
value
,
// Must access the parent to make an option select properly
// Support: IE9, IE10
optSelected
:
opt
.
selected
,
// Makes sure cloning an html5 element does not cause problems
// Where outerHTML is undefined, this still works
html5Clone
:
document
.
createElement
(
"nav"
).
cloneNode
(
true
).
outerHTML
!==
"<:nav></:nav>"
,
...
...
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