Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
SWLab UI
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Jobs
Commits
Open sidebar
SWD
SWLab UI
Commits
81936a8d
Commit
81936a8d
authored
Oct 17, 2024
by
minseok.park
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test navigation
parent
70be7c45
Pipeline
#21457
passed with stages
in 4 minutes and 24 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
01-nav.js
src/js/01-nav.js
+12
-0
No files found.
src/js/01-nav.js
View file @
81936a8d
...
@@ -38,6 +38,18 @@
...
@@ -38,6 +38,18 @@
}
}
})
})
// nav-link 클릭 시 첫 번째 항목으로 이동 처리
document
.
querySelectorAll
(
'.nav-link'
).
forEach
(
function
(
link
)
{
link
.
addEventListener
(
'click'
,
function
(
e
)
{
e
.
preventDefault
()
// 기본 링크 동작 방지
var
parentToggle
=
link
.
closest
(
'.nav-item'
).
querySelector
(
'.nav-item-toggle'
)
if
(
parentToggle
)
{
parentToggle
.
click
()
// 트리 토글
}
window
.
location
.
href
=
link
.
href
// 첫 번째 링크로 이동
})
})
if
(
navMenuToggle
&&
menuPanel
.
querySelector
(
'.nav-item-toggle'
))
{
if
(
navMenuToggle
&&
menuPanel
.
querySelector
(
'.nav-item-toggle'
))
{
navMenuToggle
.
style
.
display
=
''
navMenuToggle
.
style
.
display
=
''
navMenuToggle
.
addEventListener
(
'click'
,
function
()
{
navMenuToggle
.
addEventListener
(
'click'
,
function
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment