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
5a8f7693
Commit
5a8f7693
authored
Feb 05, 2014
by
Oleg Gaidarenko
Committed by
Dave Methvin
Mar 21, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CSS: jQuery#hide should always save display value
Fixes #14750 Closes gh-1509
parent
85af4e64
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
6 deletions
+13
-6
css.js
src/css.js
+3
-6
css.js
test/unit/css.js
+10
-0
No files found.
src/css.js
View file @
5a8f7693
...
@@ -177,13 +177,10 @@ function showHide( elements, show ) {
...
@@ -177,13 +177,10 @@ function showHide( elements, show ) {
values
[
index
]
=
data_priv
.
access
(
elem
,
"olddisplay"
,
defaultDisplay
(
elem
.
nodeName
)
);
values
[
index
]
=
data_priv
.
access
(
elem
,
"olddisplay"
,
defaultDisplay
(
elem
.
nodeName
)
);
}
}
}
else
{
}
else
{
hidden
=
isHidden
(
elem
);
if
(
!
values
[
index
]
)
{
if
(
display
!==
"none"
||
!
hidden
)
{
hidden
=
isHidden
(
elem
);
data_priv
.
set
(
elem
,
"olddisplay"
,
hidden
?
display
:
jQuery
.
css
(
elem
,
"display"
)
);
if
(
display
&&
display
!==
"none"
||
!
hidden
)
{
data_priv
.
set
(
elem
,
"olddisplay"
,
hidden
?
display
:
jQuery
.
css
(
elem
,
"display"
)
);
}
}
}
}
}
}
}
...
...
test/unit/css.js
View file @
5a8f7693
...
@@ -1048,6 +1048,16 @@ asyncTest( "Make sure initialized display value for disconnected nodes is correc
...
@@ -1048,6 +1048,16 @@ asyncTest( "Make sure initialized display value for disconnected nodes is correc
jQuery
.
_removeData
(
jQuery
(
"#display"
)[
0
]
);
jQuery
.
_removeData
(
jQuery
(
"#display"
)[
0
]
);
});
});
test
(
"show() after hide() should always set display to initial value (#14750)"
,
1
,
function
()
{
var
div
=
jQuery
(
"<div />"
),
fixture
=
jQuery
(
"#qunit-fixture"
);
fixture
.
append
(
div
);
div
.
css
(
"display"
,
"inline"
).
hide
().
show
().
css
(
"display"
,
"list-item"
).
hide
().
show
();
equal
(
div
.
css
(
"display"
),
"list-item"
,
"should get last set display value"
);
});
// Support: IE < 11, Safari < 7
// Support: IE < 11, Safari < 7
// We have to jump through the hoops here in order to test work with "order" CSS property,
// We have to jump through the hoops here in order to test work with "order" CSS property,
// that some browsers do not support. This test is not, strictly speaking, correct,
// that some browsers do not support. This test is not, strictly speaking, correct,
...
...
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