Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drawing-app
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
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
sweng-group-15
drawing-app
Commits
a8b1e97a
Commit
a8b1e97a
authored
5 years ago
by
Giovanni Caruso
Browse files
Options
Downloads
Patches
Plain Diff
Fixed slider value not being updated on reloading
parent
c31410ad
No related branches found
Branches containing commit
No related tags found
1 merge request
!55
Avatar
Pipeline
#105477
failed
5 years ago
Stage: fetch
Stage: deps
Stage: check
Stage: build
Stage: test
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.eslintrc.json
+1
-1
1 addition, 1 deletion
.eslintrc.json
public/index.html
+10
-8
10 additions, 8 deletions
public/index.html
src/app.js
+1
-1
1 addition, 1 deletion
src/app.js
src/tool-selection.js
+8
-1
8 additions, 1 deletion
src/tool-selection.js
with
20 additions
and
11 deletions
.eslintrc.json
+
1
−
1
View file @
a8b1e97a
...
...
@@ -5,7 +5,7 @@
"node"
:
true
,
"jest"
:
true
},
"extends"
:
[
"eslint:recommended"
,
"prettier"
],
"extends"
:
[
"eslint:recommended"
],
"globals"
:
{
"Atomics"
:
"readonly"
,
"SharedArrayBuffer"
:
"readonly"
...
...
This diff is collapsed.
Click to expand it.
public/index.html
+
10
−
8
View file @
a8b1e97a
...
...
@@ -13,14 +13,16 @@
/>
<script>
if
(
navigator
.
serviceWorker
)
{
navigator
.
serviceWorker
.
register
(
"
service-worker.js
"
).
then
(
(
registration
)
=>
console
.
log
(
`Service worker registered on scope
${
registration
.
scope
}
`
,
),
(
reason
)
=>
console
.
log
(
`Service worker failed to register ~
${
reason
}
`
),
)
navigator
.
serviceWorker
.
register
(
"
service-worker.js
"
)
.
then
(
(
registration
)
=>
console
.
log
(
`Service worker registered on scope
${
registration
.
scope
}
`
,
),
(
reason
)
=>
console
.
log
(
`Service worker failed to register ~
${
reason
}
`
),
)
}
</script>
</head>
...
...
This diff is collapsed.
Click to expand it.
src/app.js
+
1
−
1
View file @
a8b1e97a
...
...
@@ -8,6 +8,7 @@ import * as HTML from "./elements.js"
import
{
connect
}
from
"
./room.js
"
import
*
as
toolSelection
from
"
./tool-selection.js
"
import
*
as
humanhash
from
"
humanhash
"
import
jdenticon
from
"
jdenticon
"
const
TEST_ROOM
=
"
imperial
"
...
...
@@ -161,7 +162,6 @@ const getOrInsertPeerById = (id) => {
const
peerElem
=
document
.
createElement
(
"
li
"
)
const
jdenticon
=
require
(
"
jdenticon
"
)
const
avatarImage
=
document
.
createElement
(
"
svg
"
)
avatarImage
.
innerHTML
=
jdenticon
.
toSvg
(
id
,
50
)
avatarImage
.
className
=
"
avatar
"
...
...
This diff is collapsed.
Click to expand it.
src/tool-selection.js
+
8
−
1
View file @
a8b1e97a
...
...
@@ -49,11 +49,18 @@ HTML.picker.addEventListener("change", () => {
HTML
.
slider
.
oninput
=
function
()
{
HTML
.
output
.
innerHTML
=
this
.
value
strokeRadius
=
this
.
value
/
10
strokeRadius
=
this
.
value
/
2
}
HTML
.
output
.
innerHTML
=
HTML
.
slider
.
value
// If the page has been refreshed
if
(
performance
.
navigation
.
type
==
1
)
{
const
sliderValue
=
parseInt
(
HTML
.
output
.
innerHTML
)
HTML
.
slider
.
setAttribute
(
"
value
"
,
sliderValue
)
strokeRadius
=
sliderValue
/
2
}
const
x
=
window
.
matchMedia
(
"
only screen and (orientation: landscape) and (max-width: 600px)
"
,
)
...
...
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