Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
Theme
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
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
osuny
Theme
Commits
1600d549
Commit
1600d549
authored
2 years ago
by
Olivia206
Browse files
Options
Downloads
Patches
Plain Diff
Dropdown
parent
aa708fa9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
assets/js/theme/design-system/dropdown.js
+33
-0
33 additions, 0 deletions
assets/js/theme/design-system/dropdown.js
assets/js/theme/index.js
+1
-0
1 addition, 0 deletions
assets/js/theme/index.js
assets/sass/_theme/sections/diplomas.sass
+20
-2
20 additions, 2 deletions
assets/sass/_theme/sections/diplomas.sass
with
54 additions
and
2 deletions
assets/js/theme/design-system/dropdown.js
0 → 100644
+
33
−
0
View file @
1600d549
const
CLASSES
=
{
DropdownOpened
:
'
is-opened
'
};
class
Dropdown
{
constructor
(
selector
)
{
this
.
element
=
document
.
querySelector
(
selector
);
this
.
dropdownButton
=
this
.
element
.
querySelector
(
'
button
'
);
this
.
state
=
{
isOpened
:
false
};
this
.
listen
();
}
listen
()
{
this
.
dropdownButton
.
addEventListener
(
'
click
'
,
()
=>
{
this
.
toggleDropdown
();
});
}
toggleDropdown
(
open
=
!
this
.
state
.
isOpened
)
{
console
.
log
(
'
lalala
'
)
let
classAction
;
this
.
state
.
isOpened
=
open
;
classAction
=
this
.
state
.
isOpened
?
'
add
'
:
'
remove
'
;
this
.
dropdownButton
.
setAttribute
(
'
aria-expanded
'
,
this
.
state
.
isOpened
);
this
.
element
.
classList
[
classAction
](
CLASSES
.
DropdownOpened
);
}
}
export
default
new
Dropdown
(
'
.diplomas-select
'
);
This diff is collapsed.
Click to expand it.
assets/js/theme/index.js
+
1
−
0
View file @
1600d549
import
'
./body.js
'
;
import
'
./blocks/keyFigures
'
;
import
'
./blocks/timeline
'
;
import
'
./design-system/dropdown
'
;
import
'
./nav/stickyNav
'
;
// import './nav/responsive';
import
'
./nav/mainMenu
'
;
This diff is collapsed.
Click to expand it.
assets/sass/_theme/sections/diplomas.sass
+
20
−
2
View file @
1600d549
...
...
@@ -27,6 +27,7 @@ ul.diplomas
.dropdown-menu
@include
inset
(
100%
,
0
,
auto
,
auto
)
background-color
:
black
display
:
none
position
:
absolute
@include
media-breakpoint-down
(
md
)
// padding-left: $container-gutter-width
...
...
@@ -34,8 +35,8 @@ ul.diplomas
&
,
a
color
:
white
display
:
block
a
display
:
block
padding
:
$spacing0
white-space
:
normal
&
:not
(
:first-child
)
...
...
@@ -45,4 +46,21 @@ ul.diplomas
&
:hover
background-color
:
lighten
(
black
,
3
)
&
:focus
color
:
black
\ No newline at end of file
color
:
black
button
[
aria-expanded
=
"true"
]
@include
icon
(
'caret-top'
,
'after'
)
+
.dropdown-menu
display
:
block
// TODO : style de l'icone
// button::after,
// button[aria-expanded="true"]::after
// display: inline-block
// font-family: Icon
// font-size: .375rem
// font-weight: 400
// line-height: 1
// margin-left: 0.3125rem
// vertical-align: middle
\ 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