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
004f82a9
Commit
004f82a9
authored
Oct 30, 2014
by
Aron Carroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Guest#setVisibleHighlights will always toggle highlights
parent
3ee0db43
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
11 deletions
+18
-11
guest.coffee
h/static/scripts/guest.coffee
+18
-11
No files found.
h/static/scripts/guest.coffee
View file @
004f82a9
...
...
@@ -3,13 +3,15 @@ $ = Annotator.$
class
Annotator
.
Guest
extends
Annotator
SHOW_HIGHLIGHTS_CLASS
=
'annotator-highlights-always-on'
# Events to be bound on Annotator#element.
events
:
".annotator-adder button click"
:
"onAdderClick"
".annotator-adder button mousedown"
:
"onAdderMousedown"
".annotator-adder button mouseup"
:
"onAdderMouseup"
"setTool"
:
"onSetTool"
"setVisibleHighlights"
:
"
onS
etVisibleHighlights"
"setVisibleHighlights"
:
"
s
etVisibleHighlights"
# Plugin configuration
options
:
...
...
@@ -314,10 +316,23 @@ class Annotator.Guest extends Annotator
method
:
'setTool'
params
:
name
setVisibleHighlights
:
(
state
)
->
# Pass true to show the highlights in the frame or false to disable.
setVisibleHighlights
:
(
shouldShowHighlights
)
->
return
if
@
visibleHighlights
==
shouldShowHighlights
@
panel
?
.
notify
method
:
'setVisibleHighlights'
params
:
state
params
:
shouldShowHighlights
this
.
toggleHighlightClass
(
shouldShowHighlights
or
@
tool
==
'highlight'
)
toggleHighlightClass
:
(
shouldShowHighlights
)
->
if
shouldShowHighlights
@
element
.
addClass
(
SHOW_HIGHLIGHTS_CLASS
)
else
@
element
.
removeClass
(
SHOW_HIGHLIGHTS_CLASS
)
@
visibleHighlights
=
shouldShowHighlights
addComment
:
->
this
.
showEditor
(
this
.
createAnnotation
())
...
...
@@ -355,11 +370,3 @@ class Annotator.Guest extends Annotator
this
.
setVisibleHighlights
this
.
visibleHighlights
when
'highlight'
this
.
setVisibleHighlights
true
onSetVisibleHighlights
:
(
state
)
->
markerClass
=
'annotator-highlights-always-on'
if
state
or
this
.
tool
is
'highlight'
@
element
.
addClass
markerClass
else
@
element
.
removeClass
markerClass
this
.
visibleHighlights
=
state
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