Commit 62a503f0 authored by csillag's avatar csillag

Avoid accidental double calculation

parent 2811fcd3
......@@ -282,11 +282,10 @@ class Annotator.Guest extends Annotator
return confirm "You have selected a very short piece of text: only " + length + " chars. Are you sure you want to highlight this?"
onSuccessfulSelection: (event, immediate) ->
# Describe the selection with targets
@selectedTargets = (@_getTargetFromSelection(s) for s in event.segments)
if @tool is 'highlight'
# Describe the selection with targets
@selectedTargets = (@_getTargetFromSelection(s) for s in event.segments)
# Are we allowed to create annotations? Return false if we can't.
unless @canAnnotate
return false
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment