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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sweng-group-15
drawing-app
Merge requests
!48
Intuitive erasing
Code
Review changes
Check out branch
Download
Patches
Plain diff
Expand sidebar
Merged
Intuitive erasing
intuitive-erasing
into
master
Overview
23
Commits
26
Pipelines
12
Changes
8
Merged
Intuitive erasing
Iurii Maksymets
requested to merge
intuitive-erasing
into
master
Oct 31, 2019
Overview
11
Commits
26
Pipelines
12
Changes
1
Closes
!49 (closed)
.
Edited
Nov 1, 2019
by
Nayeem Rahman
0
1
Merge request reports
Compare
version 3
version 11
7c7039dc
Nov 1, 2019
version 10
6730547a
Oct 31, 2019
version 9
043f6d41
Oct 31, 2019
version 8
6730547a
Oct 31, 2019
version 7
eecd4a1c
Oct 31, 2019
version 6
fc0f66dc
Oct 31, 2019
version 5
ccb7c4b5
Oct 31, 2019
version 4
bf07570a
Oct 31, 2019
version 3
bd37c8dd
Oct 31, 2019
version 2
559a14fa
Oct 31, 2019
version 1
b6de3e45
Oct 31, 2019
master (base)
and
version 4
latest version
9c5ea0cb
26 commits,
Nov 1, 2019
version 11
7c7039dc
25 commits,
Nov 1, 2019
version 10
6730547a
24 commits,
Oct 31, 2019
version 9
043f6d41
25 commits,
Oct 31, 2019
version 8
6730547a
24 commits,
Oct 31, 2019
version 7
eecd4a1c
23 commits,
Oct 31, 2019
version 6
fc0f66dc
22 commits,
Oct 31, 2019
version 5
ccb7c4b5
21 commits,
Oct 31, 2019
version 4
bf07570a
20 commits,
Oct 31, 2019
version 3
bd37c8dd
19 commits,
Oct 31, 2019
version 2
559a14fa
18 commits,
Oct 31, 2019
version 1
b6de3e45
17 commits,
Oct 31, 2019
Show latest version
1 file
+
39
−
33
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
src/room.js
+
39
−
33
View file @ bf07570a
Edit in single-file editor
Open in Web IDE
Show full file
@@ -145,60 +145,66 @@ class Room extends EventTarget {
mergeIntervals
:
"
Map
"
,
},
})
const
dispatchRemovedIntervalsEvent
=
(
lineEvent
)
=>
{
const
id
=
lineEvent
.
name
const
intervals
=
this
.
_generateRemovedIntervals
(
id
)
const
points
=
this
.
_generatePath
(
id
)
const
detail
=
{
id
,
intervals
,
points
}
this
.
dispatchEvent
(
new
CustomEvent
(
"
removedIntervalsChange
"
,
{
detail
,
}),
)
}
const
dispatchPathUpdateEvent
=
(
lineEvent
)
=>
{
const
id
=
lineEvent
.
name
const
points
=
this
.
_generatePath
(
id
)
const
detail
=
{
id
,
points
}
this
.
dispatchEvent
(
new
CustomEvent
(
"
addOrUpdatePath
"
,
{
detail
}))
}
this
.
_y
.
share
.
strokeAdd
.
observe
((
lineEvent
)
=>
{
if
(
lineEvent
.
type
==
"
add
"
)
{
const
points
=
this
.
_generatePath
(
lineEvent
.
name
)
const
detail
=
{
id
:
lineEvent
.
name
,
points
}
this
.
dispatchEvent
(
new
CustomEvent
(
"
addOrUpdatePath
"
,
{
detail
}))
dispatchPathUpdateEvent
(
lineEvent
)
lineEvent
.
value
.
observe
((
pointEvent
)
=>
{
if
(
pointEvent
.
type
==
"
insert
"
)
{
const
points
=
this
.
_generatePath
(
lineEvent
.
name
)
const
detail
=
{
id
:
lineEvent
.
name
,
points
}
this
.
dispatchEvent
(
new
CustomEvent
(
"
addOrUpdatePath
"
,
{
detail
}))
dispatchPathUpdateEvent
(
lineEvent
)
}
})
}
})
this
.
_y
.
share
.
strokeErase
.
observe
((
lineEvent
)
=>
{
if
(
lineEvent
.
type
==
"
add
"
)
{
const
points
=
this
.
_generatePath
(
lineEvent
.
name
)
const
detail
=
{
id
:
lineEvent
.
name
,
points
}
this
.
dispatchEvent
(
new
CustomEvent
(
"
addOrUpdatePath
"
,
{
detail
}))
dispatchPathUpdateEvent
(
lineEvent
)
lineEvent
.
value
.
observe
((
pointEvent
)
=>
{
if
(
pointEvent
.
type
==
"
add
"
)
{
const
points
=
this
.
_generatePath
(
lineEvent
.
name
)
const
detail
=
{
id
:
lineEvent
.
name
,
points
}
this
.
dispatchEvent
(
new
CustomEvent
(
"
addOrUpdatePath
"
,
{
detail
}))
dispatchPathUpdateEvent
(
lineEvent
)
}
})
}
})
this
.
sharedMergeIntervals
.
observe
((
lineEvent
)
=>
{
if
(
lineEvent
.
type
==
"
add
"
)
{
const
dispatchEvent
=
()
=>
{
const
id
=
lineEvent
.
name
const
intervals
=
this
.
_generateRemovedIntervals
(
id
)
const
points
=
this
.
_generatePath
(
lineEvent
.
name
)
this
.
dispatchEvent
(
new
CustomEvent
(
"
removedIntervalsChange
"
,
{
detail
:
{
id
,
intervals
,
points
},
}),
)
}
if
(
lineEvent
.
type
!=
"
add
"
)
{
return
}
dispatchEvent
(
)
dispatch
RemovedIntervalsEvent
(
line
Event
)
lineEvent
.
value
.
observe
((
pointEvent
)
=>
{
if
(
pointEvent
.
type
==
"
add
"
)
{
dispatchEvent
()
lineEvent
.
value
.
observe
((
pointEvent
)
=>
{
if
(
pointEvent
.
type
!=
"
add
"
)
{
return
}
pointEvent
.
value
.
observe
(()
=>
{
dispatchEvent
()
})
}
dispatchRemovedIntervalsEvent
(
lineEvent
)
pointEvent
.
value
.
observe
(()
=>
{
dispatchRemovedIntervalsEvent
(
lineEvent
)
})
}
}
)
})
}
}
Loading