Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
UI Styleguide Koalicni
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TO
Weby
UI Styleguide Koalicni
Commits
c6a14c06
Commit
c6a14c06
authored
4 years ago
by
fanky
Browse files
Options
Downloads
Patches
Plain Diff
accordeon - js to smooth collapse
parent
d193eabf
No related branches found
No related tags found
No related merge requests found
Pipeline
#3087
passed
4 years ago
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
source/_patterns/01-molecules/22-accordeon/accordeon.mustache
+16
-1
16 additions, 1 deletion
...ce/_patterns/01-molecules/22-accordeon/accordeon.mustache
source/css/atoms/collapsibles.pcss
+7
-2
7 additions, 2 deletions
source/css/atoms/collapsibles.pcss
with
23 additions
and
3 deletions
source/_patterns/01-molecules/22-accordeon/accordeon.mustache
+
16
−
1
View file @
c6a14c06
<div
class=
"space-y-1"
>
{{>
atoms-accordeon-row
}}
{{>
atoms-accordeon-row
}}
</div>
\ No newline at end of file
</div>
<script>
document
.
addEventListener
(
"
DOMContentLoaded
"
,
setMaxHeights
);
window
.
addEventListener
(
'
resize
'
,
setMaxHeights
);
function
setMaxHeights
(){
// set height for css transition
var
accordeonRowBodies
=
document
.
getElementsByClassName
(
'
accordeon-row-body
'
);
if
(
accordeonRowBodies
!==
null
)
{
for
(
var
i
=
0
;
i
<
accordeonRowBodies
.
length
;
i
++
)
{
accordeonRowBodies
[
i
].
style
.
maxHeight
=
accordeonRowBodies
[
i
].
scrollHeight
+
"
px
"
;
};
}
}
</script>
This diff is collapsed.
Click to expand it.
source/css/atoms/collapsibles.pcss
+
7
−
2
View file @
c6a14c06
...
...
@@ -19,7 +19,7 @@
-o-transition: max-height 0.5s ease;
transition: max-height 0.5s ease;
p{
@apply px-8 pt-8 pb-14;
@apply px-8 pt-8 pb-14
box-border
;
}
}
...
...
@@ -29,6 +29,11 @@
@apply absolute top-1/2 right-8 transform -translate-y-2/4 rotate-90;
}
.accordeon-row-body{
max-height: 1000px;
max-height: 2000px; /* max-height set by js, css fallback to high number */
}
}
.accordeon-row:not(.accordeon-row--open){
.accordeon-row-body{
max-height: 0px!important
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment