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
42c8ac83
Commit
42c8ac83
authored
Sep 09, 2014
by
Randall Leeds
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Drop annotator.discardDrafts helper
The annotator service is not a dumping ground for helper functions.
parent
1e5c93a3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
9 deletions
+5
-9
controllers.coffee
h/static/scripts/controllers.coffee
+4
-4
services.coffee
h/static/scripts/services.coffee
+1
-5
No files found.
h/static/scripts/controllers.coffee
View file @
42c8ac83
...
...
@@ -13,12 +13,12 @@ class App
this
.
$inject
=
[
'$location'
,
'$q'
,
'$route'
,
'$scope'
,
'$timeout'
,
'annotator'
,
'flash'
,
'identity'
,
'socket'
,
'streamfilter'
,
'documentHelpers'
'documentHelpers'
,
'drafts'
]
constructor
:
(
$location
,
$q
,
$route
,
$scope
,
$timeout
annotator
,
flash
,
identity
,
socket
,
streamfilter
,
documentHelpers
documentHelpers
,
drafts
)
->
{
plugins
,
host
,
providers
}
=
annotator
...
...
@@ -65,7 +65,7 @@ class App
onlogin
(
assertion
)
onlogout
:
->
onlogout
()
else
if
annotator
.
discardDrafts
()
else
if
drafts
.
discard
()
if
claimedUser
identity
.
request
()
else
...
...
@@ -324,7 +324,7 @@ class App
update
:
(
query
)
->
unless
angular
.
equals
$location
.
search
()[
'q'
],
query
if
annotator
.
discardDrafts
()
if
drafts
.
discard
()
$location
.
search
(
'q'
,
query
or
null
)
$scope
.
socialView
=
annotator
.
socialView
...
...
h/static/scripts/services.coffee
View file @
42c8ac83
...
...
@@ -384,7 +384,7 @@ class Hypothesis extends Annotator
setTool
:
(
name
)
->
return
if
name
is
@
tool
return
unless
this
.
discardDrafts
()
return
unless
@
element
.
injector
().
get
(
'drafts'
).
discard
()
if
name
is
'highlight'
# Check login state first
...
...
@@ -416,10 +416,6 @@ class Hypothesis extends Annotator
method
:
'setVisibleHighlights'
params
:
state
# Discard all drafts, deleting unsaved annotations from the annotator
discardDrafts
:
->
return
@
element
.
injector
().
get
(
'drafts'
).
discard
()
class
DraftProvider
drafts
:
null
...
...
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