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
4615ffbe
Commit
4615ffbe
authored
Jan 29, 2013
by
Randall Leeds
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more consistent $apply on Annotator events
parent
65d16eb4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
12 deletions
+19
-12
controllers.coffee
h/js/controllers.coffee
+19
-12
No files found.
h/js/controllers.coffee
View file @
4615ffbe
...
...
@@ -181,25 +181,30 @@ class App
class
Annotation
this
.
$inject
=
[
'$element'
,
'$scope'
,
'$rootScope'
,
'$timeout'
,
'$element'
,
'$
location'
,
'$
scope'
,
'$rootScope'
,
'$timeout'
,
'annotator'
,
'threading'
]
constructor
:
(
$element
,
$scope
,
$rootScope
,
$timeout
$element
,
$
location
,
$
scope
,
$rootScope
,
$timeout
annotator
,
threading
)
->
publish
=
(
args
...)
->
# Publish after a timeout to escape this digest
# Annotator event callbacks don't expect a digest to be active
$timeout
(
->
annotator
.
publish
args
...),
0
,
false
$scope
.
cancel
=
->
$scope
.
editing
=
false
if
$scope
.
$modelValue
.
draft
annotator
.
publish
'annotationDeleted'
,
$scope
.
$modelValue
publish
'annotationDeleted'
,
$scope
.
$modelValue
$scope
.
save
=
->
$scope
.
editing
=
false
$scope
.
$modelValue
.
draft
=
false
if
$scope
.
edited
annotator
.
publish
'annotationUpdated'
,
$scope
.
$modelValue
publish
'annotationUpdated'
,
$scope
.
$modelValue
else
annotator
.
publish
'annotationCreated'
,
$scope
.
$modelValue
publish
'annotationCreated'
,
$scope
.
$modelValue
$scope
.
reply
=
->
unless
annotator
.
plugins
.
Auth
.
haveValidToken
()
...
...
@@ -236,15 +241,17 @@ class Editor
annotator
,
threading
)
->
save
=
->
$location
.
path
(
'/viewer'
).
replace
()
annotator
.
provider
.
onEditorSubmit
()
annotator
.
provider
.
onEditorHide
()
$scope
.
$apply
->
$location
.
path
(
'/viewer'
).
replace
()
annotator
.
provider
.
onEditorSubmit
()
annotator
.
provider
.
onEditorHide
()
cancel
=
->
search
=
$location
.
search
()
or
{}
delete
search
.
id
$location
.
path
(
'/viewer'
).
search
(
search
).
replace
()
annotator
.
provider
.
onEditorHide
()
$scope
.
$apply
->
search
=
$location
.
search
()
or
{}
delete
search
.
id
$location
.
path
(
'/viewer'
).
search
(
search
).
replace
()
annotator
.
provider
.
onEditorHide
()
annotator
.
subscribe
'annotationCreated'
,
save
annotator
.
subscribe
'annotationDeleted'
,
cancel
...
...
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