Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
TAM
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
EIP
Labrador
TAM
Commits
2dd53603
Commit
2dd53603
authored
Nov 14, 2023
by
Danae Savvidi
Browse files
Options
Downloads
Patches
Plain Diff
save toggling smoother & expand click on accordion
parent
571486f1
No related branches found
No related tags found
2 merge requests
!343
Deploy 2.1.7
,
!341
Resolve "Save toggling on Job Offers Page for Students"
Pipeline
#965786
failed
Nov 14, 2023
Stage: build
Stage: prepare
Stage: test
Stage: publish
Stage: review
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/resources/templates/job_offer/view_many.html
+10
-15
10 additions, 15 deletions
src/main/resources/templates/job_offer/view_many.html
with
10 additions
and
15 deletions
src/main/resources/templates/job_offer/view_many.html
+
10
−
15
View file @
2dd53603
...
...
@@ -88,7 +88,6 @@
<div
class=
"flex justify-end"
>
<button
class=
"fa-solid fa-chevron-down"
th:aria-expanded=
"${expanded}"
th:aria-controls=
"|edition-${edition.id}|"
></button>
</div>
</td>
...
...
@@ -97,8 +96,7 @@
<tbody
class=
"accordion__content"
th:id=
"|edition-${edition.id}|"
th:aria-expanded=
"${expanded}"
>
th:id=
"|edition-${edition.id}|"
>
<tr
th:each=
"offer : ${edition.offers}"
th:if=
"${!offer.hidden}"
...
...
@@ -236,22 +234,19 @@
<script
th:inline=
"text"
>
$
(
document
).
ready
(
function
()
{
$
(
'
button
'
).
on
(
'
click
'
,
function
()
{
let
accordionId
=
$
(
this
).
attr
(
'
aria-controls
'
);
let
isExpanded
=
$
(
this
).
attr
(
'
aria-expanded
'
);
console
.
log
(
"
(click) change state of
"
+
accordionId
+
"
to
"
+
isExpanded
);
localStorage
.
setItem
(
accordionId
,
isExpanded
);
});
$
(
'
[class="accordion__content"]
'
).
each
(
function
()
{
let
accordionId
=
$
(
this
).
attr
(
'
id
'
);
let
isExpanded
=
localStorage
.
getItem
(
accordionId
);
if
(
isExpanded
!==
null
)
{
console
.
log
(
"
update state of
"
+
accordionId
+
"
to
"
+
isExpanded
);
$
(
'
tbody[id="
'
+
accordionId
+
'
"]
'
).
attr
(
'
aria-expanded
'
,
isExpanded
);
$
(
'
button[aria-controls="
'
+
accordionId
+
'
"]
'
).
attr
(
'
aria-expanded
'
,
isExpanded
);
let
isExpanded
=
localStorage
.
getItem
(
accordionId
)
??
/*[[${expanded}]]*/
true
;
if
(
localStorage
.
getItem
(
accordionId
)
!=
null
)
{
$
(
'
tbody[id="
'
+
accordionId
+
'
"], button[aria-controls="
'
+
accordionId
+
'
"]
'
).
attr
(
'
aria-expanded
'
,
isExpanded
);
}
});
$
(
'
button, tbody.accordion__header
'
).
on
(
'
click
'
,
function
()
{
let
accordionId
=
$
(
this
).
closest
(
'
tbody.accordion__header
'
).
find
(
'
button
'
).
attr
(
'
aria-controls
'
);
let
isExpanded
=
$
(
this
).
closest
(
'
tbody.accordion__header
'
).
find
(
'
button
'
).
attr
(
'
aria-expanded
'
);
localStorage
.
setItem
(
accordionId
,
isExpanded
);
});
});
$
(()
=>
{
...
...
...
...
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
sign in
to comment