Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
earth-in-flux
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
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
Water Mission Area
VizLab
earth-in-flux
Commits
d665d296
Commit
d665d296
authored
1 week ago
by
Hayley Corson-Dosch
Browse files
Options
Downloads
Patches
Plain Diff
fix accordion button click event for symbol
parent
9ab34e9a
No related branches found
No related tags found
1 merge request
!94
Global maps layout
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/components/FindexGlobalThreatsViz.vue
+3
-4
3 additions, 4 deletions
src/components/FindexGlobalThreatsViz.vue
with
3 additions
and
4 deletions
src/components/FindexGlobalThreatsViz.vue
+
3
−
4
View file @
d665d296
...
...
@@ -79,7 +79,7 @@
<div
v-for=
"item, index in subCategoryData.subThreatText"
:key=
"index"
class=
"accordion-container"
:class=
"`${tab.tabContentTitleID}-accordion`"
>
<button
class=
"accordion"
:class=
"[`${tab.tabContentTitleID}-bkgd`, { 'active': item.activeOnLoad }]"
@
click=
"accordionClick"
>
<h4
class=
"accordion-button-text"
v-html=
"item.heading"
></h4>
<span
class=
"symbol"
></span>
<span
class=
"
accordion-button-text
symbol"
></span>
</button>
<div
class=
"panel"
:class=
"[{ 'active': item.activeOnLoad }]"
>
<p
v-if=
"!primaryCategorySelected"
v-html=
"item.text"
/>
...
...
@@ -195,12 +195,11 @@
return
new
URL
(
`../assets/images/
${
file
}
`
,
import
.
meta
.
url
).
href
}
function
accordionClick
(
event
)
{
// Pull class associated with target
// Pull class
(es)
associated with target
const
targetClass
=
event
.
target
.
classList
.
value
console
.
log
(
targetClass
)
// If the target is the button text, target the parent button element
// Otherwise if the target is the button, target it directly
const
accordion
=
targetClass
==
'
accordion-button-text
'
?
event
.
target
.
parentElement
:
event
.
target
const
accordion
=
targetClass
.
includes
(
'
accordion-button-text
'
)
?
event
.
target
.
parentElement
:
event
.
target
accordion
.
classList
.
toggle
(
"
active
"
);
const
panel
=
accordion
.
nextElementSibling
;
panel
.
classList
.
toggle
(
"
active
"
);
...
...
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