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
Oct 11, 2024
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
Show 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 @@
`
// 네트워크 상태 확인 및 버튼 제어
function
toggleChatButton
()
{
console
.
log
(
navigator
.
onLine
)
if
(
!
navigator
.
onLine
)
{
function
checkIfLocalFile
()
{
if
(
window
.
location
.
protocol
===
'file:'
)
{
chatButton
.
style
.
display
=
'none'
// 오프라인 상태면 chatButton 숨김
}
else
{
chatButton
.
style
.
display
=
'flex'
// 온라인 상태면 chatButton 보이게 함
...
...
@@ -70,11 +69,7 @@
}
// 초기 상태 설정
toggleChatButton
()
// 네트워크 상태 변경 이벤트 리스너
window
.
addEventListener
(
'online'
,
toggleChatButton
)
window
.
addEventListener
(
'offline'
,
toggleChatButton
)
checkIfLocalFile
()
chatButton
.
addEventListener
(
'click'
,
()
=>
{
chat
.
classList
.
toggle
(
'show'
)
...
...
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