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
6f9a7621
Commit
6f9a7621
authored
10 months ago
by
Olivia206
Browse files
Options
Downloads
Patches
Plain Diff
fixed animation
parent
deadaa07
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
assets/js/theme/design-system/modal.js
+7
-2
7 additions, 2 deletions
assets/js/theme/design-system/modal.js
assets/sass/_theme/design-system/layout.sass
+8
-1
8 additions, 1 deletion
assets/sass/_theme/design-system/layout.sass
with
15 additions
and
3 deletions
assets/js/theme/design-system/modal.js
+
7
−
2
View file @
6f9a7621
import
{
focusTrap
}
from
'
../utils/focus-trap
'
;
const
CLASSES
=
{
modalOpened
:
'
has-modal-opened
'
modalOpened
:
'
has-modal-opened
'
,
modalIsOpened
:
'
is-opened
'
};
class
Modal
{
...
...
@@ -44,7 +45,6 @@ class Modal {
});
window
.
addEventListener
(
'
click
'
,
(
event
)
=>
{
console
.
log
(
this
.
element
)
if
(
event
.
target
===
this
.
element
)
{
this
.
toggle
(
false
);
}
...
...
@@ -54,9 +54,14 @@ class Modal {
toggle
(
open
=
!
this
.
state
.
isOpened
)
{
this
.
state
.
isOpened
=
open
;
const
classAction
=
this
.
state
.
isOpened
?
'
add
'
:
'
remove
'
;
let
transitionDuration
=
window
.
getComputedStyle
(
this
.
element
).
transitionDuration
;
transitionDuration
=
parseFloat
(
transitionDuration
.
replace
(
'
s
'
,
''
));
this
.
element
.
setAttribute
(
'
aria-hidden
'
,
!
this
.
state
.
isOpened
);
document
.
documentElement
.
classList
[
classAction
](
CLASSES
.
modalOpened
);
setTimeout
(()
=>
{
this
.
element
.
classList
[
classAction
](
CLASSES
.
modalIsOpened
);
},
transitionDuration
*
1000
);
}
}
...
...
This diff is collapsed.
Click to expand it.
assets/sass/_theme/design-system/layout.sass
+
8
−
1
View file @
6f9a7621
...
...
@@ -92,7 +92,6 @@ details
transform
:
translateY
(
-5px
)
.modal
align-items
:
center
display
:
flex
justify-content
:
center
height
:
100vh
left
:
0
...
...
@@ -102,6 +101,14 @@ details
width
:
100%
margin
:
0
z-index
:
$zindex-modal
opacity
:
0
transition
:
opacity
$header-transition
html
.is-animating
&
opacity
:
0
display
:
flex
&
.is-opened
opacity
:
1
display
:
flex
&
[
aria-hidden
=
"true"
]
display
:
none
.modal-content
...
...
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