Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frontend
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
idatt2106-2024-07
frontend
Commits
8e8174e4
Commit
8e8174e4
authored
11 months ago
by
Victor Ekholt Gunrell Kaste
Browse files
Options
Downloads
Patches
Plain Diff
feat: Updated autoscroll on roadmap
parent
7b127a18
No related branches found
Branches containing commit
No related tags found
1 merge request
!21
feat: Updated autoscroll on roadmap
Pipeline
#274730
failed
11 months ago
Stage: install_dependencies
Stage: lint
Stage: build_project
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/components/SavingGoalComponents/SavingGoalRoadmap.vue
+19
-6
19 additions, 6 deletions
src/components/SavingGoalComponents/SavingGoalRoadmap.vue
with
19 additions
and
6 deletions
src/components/SavingGoalComponents/SavingGoalRoadmap.vue
+
19
−
6
View file @
8e8174e4
...
...
@@ -23,17 +23,31 @@ export default {
bluePanelMaxHeight
:
'
auto
'
as
string
};
},
mounted
()
{
this
.
togglePanel
(
this
.
steps
[
2
]);
},
methods
:
{
togglePanel
(
step
:
Step
)
{
if
(
step
.
showPanel
)
{
// If the clicked panel is already open, close it
step
.
showPanel
=
false
;
}
else
{
//Close all panels before opening new one
//Ensure only one panel open at a time
this
.
steps
.
forEach
((
s
)
=>
(
s
.
showPanel
=
false
));
//Open clicked on panel
step
.
showPanel
=
true
;
this
.
scrollToPanel
(
step
);
}
},
scrollToPanel
(
step
:
Step
)
{
if
(
step
.
showPanel
)
{
this
.
$nextTick
(()
=>
{
const
panel
=
document
.
getElementById
(
`panel-
${
this
.
steps
.
indexOf
(
step
)}
`
);
console
.
log
(
panel
);
if
(
panel
)
{
setTimeout
(()
=>
{
panel
.
scrollIntoView
({
behavior
:
'
smooth
'
,
block
:
'
center
'
});
console
.
log
(
'
I should have scrolled
'
);
},
100
);
// Wait for 1 second before scrolling
}
});
}
},
},
...
...
@@ -45,11 +59,9 @@ export default {
<div
class=
"SavingGoalTitle text-center"
>
{{
title
}}
</div>
<ul
class=
"timeline"
>
<li
v-for=
"(step, index) in steps"
:key=
"index"
:class=
"
{ 'timeline-inverted': index % 2 !== 0 }">
<a
:href=
"'#panel-' + index"
>
<div
class=
"timeline-image z-1"
@
click=
"togglePanel(step)"
>
<img
class=
"circular-image"
:src=
"step.showPanel ? altImage : image"
alt=
""
>
</div>
</a>
<div
class=
"timeline-panel z-3"
:id=
"'panel-' + index"
v-show=
"step.showPanel"
>
<div
class=
"timeline-heading"
>
<h4>
{{
step
.
title
}}
</h4>
...
...
@@ -85,6 +97,7 @@ export default {
.col-lg-8
{
width
:
63%
;
margin-bottom
:
20px
;
max-height
:
1000px
;
}
.SavingGoalTitle
{
...
...
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