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
cac1a80a
Commit
cac1a80a
authored
Oct 24, 2024
by
minseok.park
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mobile에서 download 안되는 문제 수정 및 mobile-nav ui 수정
parent
1e567166
Pipeline
#21692
passed with stages
in 4 minutes
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
2 deletions
+36
-2
05-mobile-navbar.js
src/js/05-mobile-navbar.js
+17
-1
07-header.js
src/js/07-header.js
+18
-0
header-content.hbs
src/partials/header-content.hbs
+1
-1
No files found.
src/js/05-mobile-navbar.js
View file @
cac1a80a
...
...
@@ -7,7 +7,6 @@
const
MobileMenuToggle
=
document
.
querySelector
(
'.nav-mobile-menu-toggle'
)
const
documentToggle
=
document
.
getElementById
(
'document-toggle'
)
const
documentIcon
=
document
.
getElementById
(
'document-icon'
)
const
menuIconDefault
=
`
<svg stroke="currentColor" fill="#0072ce" stroke-width="0" viewBox="0 0 24 24" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg">
<path fill="none" d="M0 0h24v24H0z"></path>
...
...
@@ -21,6 +20,23 @@
</svg>
`
// 화면 크기 감지하여 모바일 화면이 아닐 때 show 클래스 제거
function
checkWindowSize
()
{
const
menuList
=
document
.
querySelector
(
'.navbar-mobile-menu'
)
if
(
window
.
matchMedia
(
'(min-width: 1023.5px)'
).
matches
)
{
menuList
.
classList
.
remove
(
'show'
)
// 모바일 화면이 아닐 때 show 제거
MobileMenuToggle
.
innerHTML
=
menuIconDefault
// 아이콘 초기화
isMenuOpen
=
false
}
}
// 페이지 로드 시 화면 크기 체크
window
.
addEventListener
(
'load'
,
checkWindowSize
)
// 화면 크기가 변경될 때마다 체크
window
.
addEventListener
(
'resize'
,
checkWindowSize
)
// 메뉴 토글 기능
MobileMenuToggle
.
addEventListener
(
'click'
,
function
()
{
isMenuOpen
=
!
isMenuOpen
...
...
src/js/07-header.js
View file @
cac1a80a
...
...
@@ -2,6 +2,7 @@
'use strict'
var
download
=
document
.
getElementById
(
'download'
)
const
downlaodMobile
=
document
.
getElementById
(
'mobile-download'
)
document
.
addEventListener
(
'scroll'
,
function
()
{
var
navbar
=
document
.
querySelector
(
'.navbar'
)
...
...
@@ -29,4 +30,21 @@
document
.
body
.
removeChild
(
link
)
}
})
downlaodMobile
.
addEventListener
(
'click'
,
function
()
{
var
pathname
=
window
.
location
.
pathname
var
path
=
pathname
.
split
(
'/'
)
var
isInternal
=
path
[
4
].
includes
(
'-s'
)
var
filename
=
path
[
3
]
?
path
[
3
]
===
'swlab-docs'
?
'docs'
:
isInternal
?
`docs-
${
path
[
3
]}
-s`
:
`docs-
${
path
[
3
]}
`
:
''
var
directory
=
path
[
3
]
&&
path
[
4
]
?
path
[
3
]
===
'swlab-docs'
?
path
[
3
]
:
path
[
4
]
:
''
var
link
=
document
.
createElement
(
'a'
)
link
.
href
=
`https://swlab.bwg.co.kr/web/dms/download-file?filename=
${
filename
}
.zip&directory=
${
directory
}
`
link
.
click
()
if
(
link
.
parentNode
)
{
document
.
body
.
removeChild
(
link
)
}
})
})()
src/partials/header-content.hbs
View file @
cac1a80a
...
...
@@ -64,7 +64,7 @@
<li
class=
"product-link secret-nav"
onclick=
"window.location.href='https://swlab.bwg.co.kr/web/docs/swlab-docs/current/ready-to-write/text-editor.html'"
>
Manual Guide
</li>
</ul>
<li
class=
"mobile-menu-item"
>
<a
id=
"download"
class=
"button download"
href=
"#"
>
<a
id=
"
mobile-
download"
class=
"button download"
href=
"#"
>
<i
class=
"download_icon"
></i>
Download
</a>
...
...
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