Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
ceb3d7d2
Commit
ceb3d7d2
authored
Sep 11, 2013
by
Randall Leeds
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Defensive and pervasive $event.stopPropagation
parent
336c3b55
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
+12
-8
controllers.coffee
h/js/controllers.coffee
+12
-8
No files found.
h/js/controllers.coffee
View file @
ceb3d7d2
...
...
@@ -601,7 +601,8 @@ class Annotation
$scope
.
action
=
'create'
$scope
.
editing
=
false
$scope
.
cancel
=
->
$scope
.
cancel
=
(
$event
)
->
$event
?
.
stopPropagation
()
$scope
.
editing
=
false
drafts
.
remove
$scope
.
model
.
$modelValue
...
...
@@ -614,7 +615,7 @@ class Annotation
$scope
.
action
=
'create'
$scope
.
save
=
(
$event
)
->
$event
.
stopPropagation
()
$event
?
.
stopPropagation
()
annotation
=
$scope
.
model
.
$modelValue
# Forbid saving comments without a body (text or tags)
...
...
@@ -647,7 +648,8 @@ class Annotation
else
annotator
.
updateAnnotation
annotation
$scope
.
reply
=
->
$scope
.
reply
=
(
$event
)
->
$event
?
.
stopPropagation
()
unless
annotator
.
plugins
.
Auth
?
and
annotator
.
plugins
.
Auth
.
haveValidToken
()
$scope
.
$emit
'showAuth'
,
true
return
...
...
@@ -663,15 +665,17 @@ class Annotation
annotator
.
publish
'beforeAnnotationCreated'
,
[
reply
]
$scope
.
edit
=
->
$scope
.
edit
=
(
$event
)
->
$event
?
.
stopPropagation
()
$scope
.
action
=
'edit'
$scope
.
editing
=
true
$scope
.
origText
=
$scope
.
model
.
$modelValue
.
text
$scope
.
origTags
=
$scope
.
model
.
$modelValue
.
tags
drafts
.
add
$scope
.
model
.
$modelValue
$scope
.
delete
=
->
annotation
=
$scope
.
thread
.
message
$scope
.
delete
=
(
$event
)
->
$event
?
.
stopPropagation
()
annotation
=
$scope
.
model
.
$modelValue
replies
=
$scope
.
thread
.
children
?
.
length
or
0
# We can delete the annotation if it hasn't got any replies or it is
...
...
@@ -979,7 +983,7 @@ class Search
threadid
$scope
.
clickMoreTop
=
(
id
,
$event
)
->
$event
.
stopPropagation
()
$event
?
.
stopPropagation
()
threadid
=
$scope
.
getThreadId
id
pos
=
$scope
.
render_pos
[
id
]
rendered
=
$scope
.
render_order
[
threadid
]
...
...
@@ -998,7 +1002,7 @@ class Search
$scope
.
clickMoreBottom
=
(
id
,
$event
)
->
$event
.
stopPropagation
()
$event
?
.
stopPropagation
()
threadid
=
$scope
.
getThreadId
id
pos
=
$scope
.
render_pos
[
id
]
rendered
=
$scope
.
render_order
[
threadid
]
...
...
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