Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Maják
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
Container registry
Model registry
Operate
Environments
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
Maják
Commits
b1a77150
Commit
b1a77150
authored
4 years ago
by
jan.bednarik
Browse files
Options
Downloads
Patches
Plain Diff
elections2021: Program page accordeon
parent
3005e941
No related branches found
No related tags found
2 merge requests
!265
release
,
!264
Volby
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
elections2021/static/elections2021/css/styles.css
+1
-1
1 addition, 1 deletion
elections2021/static/elections2021/css/styles.css
elections2021/templates/elections2021/elections2021_program_point_page.html
+23
-19
23 additions, 19 deletions
...lates/elections2021/elections2021_program_point_page.html
with
24 additions
and
20 deletions
elections2021/static/elections2021/css/styles.css
+
1
−
1
View file @
b1a77150
This diff is collapsed.
Click to expand it.
elections2021/templates/elections2021/elections2021_program_point_page.html
+
23
−
19
View file @
b1a77150
...
...
@@ -110,24 +110,27 @@
{{ page.problem|richtext|format_sources }}
</p>
<div
id=
"v-cem-je-problem"
class=
"__js-root"
>
<div>
<div
class=
"accordeon-row accordeon-row--preview"
>
<div
onclick=
"if(this.parentElement.classList.contains('accordeon-row--open')) this.parentElement.classList.remove('accordeon-row--open'); else this.parentElement.classList.add('accordeon-row--open');"
class=
"accordeon-row-head"
>
<div
id=
"v-cem-je-problem"
>
<div
class=
"accordeon-row accordeon-row--fadeout h-full"
>
<div
class=
"accordeon-row-head"
v-on:click=
"toggleElement"
onclick=
"if(this.parentElement.classList.contains('accordeon-row--open')) this.parentElement.classList.remove('accordeon-row--open'); else this.parentElement.classList.add('accordeon-row--open');"
>
<h3
class=
"accordeon-row-heading head-alt-xs mb-0"
>
V čem je problém
</h3>
<i
class=
"ico--chevron-down"
></i>
</div>
<div
class=
"accordeon-row-body accordeon-row-body--preview"
style=
"max-height: 153px;"
>
<div
style=
"overflow: hidden;"
>
<div
class=
"clampedcontent content-block"
>
<div
class=
"accordeon-row-body accordeon-row-body--fadeout"
style=
"height: 220px; max-height: 560px;"
>
<div>
{{ page.context|richtext|format_sources }}
</div>
</div>
<button
class=
"btn btn--icon absolute bottom-8 left-8"
onclick=
"this.parentElement.classList.add('accordeon-row--open');"
>
<div
class=
"btn__body-wrap"
>
<div
class=
"btn__body bg-acidgreen -bottom-20 text-black py-4"
>
Zobrazit více
</div>
<div
class=
"btn__icon bg-black"
>
<i
class=
"ico--chevron-right"
></i>
</div>
</div>
</button>
</div>
</div>
</div>
<div
id=
"nase-vize"
class=
"ideal-check"
><i
class=
"ico--check text-xs sm:text-xl text-black"
></i></div>
...
...
@@ -288,17 +291,18 @@
</div>
<script>
document
.
addEventListener
(
"
DOMContentLoaded
"
,
setMaxHeights
);
window
.
addEventListener
(
'
resize
'
,
setMaxHeights
);
/*should run once on any page accordeon rows with fadeouts are present*/
document
.
addEventListener
(
"
DOMContentLoaded
"
,
setMaxHeightsFadeouts
);
window
.
addEventListener
(
'
resize
'
,
setMaxHeightsFadeouts
);
function
setMaxHeights
()
{
function
setMaxHeights
Fadeouts
()
{
// set height for css transition
var
accordeonRowBodies
=
document
.
getElementsByClassName
(
'
accordeon-row-body
'
);
var
accordeonRowBodies
=
document
.
getElementsByClassName
(
'
accordeon-row-body
--fadeout
'
);
if
(
accordeonRowBodies
!==
null
)
{
for
(
var
i
=
0
;
i
<
accordeonRowBodies
.
length
;
i
++
)
{
accordeonRowBodies
[
i
].
style
.
maxHeight
=
accordeonRowBodies
[
i
].
scrollHeight
+
"
px
"
;
};
accordeonRowBodies
[
i
].
style
.
maxHeight
=
(
parseInt
(
accordeonRowBodies
[
i
].
scrollHeight
)
+
32
)
+
"
px
"
;
};
/*plus padding*/
}
}
</script>
...
...
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