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
9450db34
Commit
9450db34
authored
4 months ago
by
minseok.park
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
로컬 파일 UI 테스트
parent
7e1ac9b3
Pipeline
#21373
passed with stages
in 4 minutes and 20 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
8 deletions
+3
-8
08-chat.js
src/js/08-chat.js
+3
-8
No files found.
src/js/08-chat.js
View file @
9450db34
...
@@ -60,9 +60,8 @@
...
@@ -60,9 +60,8 @@
`
`
// 네트워크 상태 확인 및 버튼 제어
// 네트워크 상태 확인 및 버튼 제어
function
toggleChatButton
()
{
function
checkIfLocalFile
()
{
console
.
log
(
navigator
.
onLine
)
if
(
window
.
location
.
protocol
===
'file:'
)
{
if
(
!
navigator
.
onLine
)
{
chatButton
.
style
.
display
=
'none'
// 오프라인 상태면 chatButton 숨김
chatButton
.
style
.
display
=
'none'
// 오프라인 상태면 chatButton 숨김
}
else
{
}
else
{
chatButton
.
style
.
display
=
'flex'
// 온라인 상태면 chatButton 보이게 함
chatButton
.
style
.
display
=
'flex'
// 온라인 상태면 chatButton 보이게 함
...
@@ -70,11 +69,7 @@
...
@@ -70,11 +69,7 @@
}
}
// 초기 상태 설정
// 초기 상태 설정
toggleChatButton
()
checkIfLocalFile
()
// 네트워크 상태 변경 이벤트 리스너
window
.
addEventListener
(
'online'
,
toggleChatButton
)
window
.
addEventListener
(
'offline'
,
toggleChatButton
)
chatButton
.
addEventListener
(
'click'
,
()
=>
{
chatButton
.
addEventListener
(
'click'
,
()
=>
{
chat
.
classList
.
toggle
(
'show'
)
chat
.
classList
.
toggle
(
'show'
)
...
...
This diff is collapsed.
Click to expand it.
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