Commit c9a615d4 authored by csillag's avatar csillag

Don't propagate mouseUp events from the toolbar. Fixes #1169

parent e911d933
...@@ -21,6 +21,7 @@ class Annotator.Plugin.Toolbar extends Annotator.Plugin ...@@ -21,6 +21,7 @@ class Annotator.Plugin.Toolbar extends Annotator.Plugin
window.annotator.showFrame() window.annotator.showFrame()
else else
window.annotator.hideFrame() window.annotator.hideFrame()
"mouseup": (event) -> event.stopPropagation()
, ,
"title": "Show Annotations" "title": "Show Annotations"
"class": "alwaysonhighlights-icon" "class": "alwaysonhighlights-icon"
...@@ -29,6 +30,7 @@ class Annotator.Plugin.Toolbar extends Annotator.Plugin ...@@ -29,6 +30,7 @@ class Annotator.Plugin.Toolbar extends Annotator.Plugin
event.stopPropagation() event.stopPropagation()
state = not window.annotator.visibleHighlights state = not window.annotator.visibleHighlights
window.annotator.setVisibleHighlights state window.annotator.setVisibleHighlights state
"mouseup": (event) -> event.stopPropagation()
, ,
"title": "Highlighting Mode" "title": "Highlighting Mode"
"class": "highlighter-icon" "class": "highlighter-icon"
...@@ -38,6 +40,7 @@ class Annotator.Plugin.Toolbar extends Annotator.Plugin ...@@ -38,6 +40,7 @@ class Annotator.Plugin.Toolbar extends Annotator.Plugin
state = not (window.annotator.tool is 'highlight') state = not (window.annotator.tool is 'highlight')
tool = if state then 'highlight' else 'comment' tool = if state then 'highlight' else 'comment'
window.annotator.setTool tool window.annotator.setTool tool
"mouseup": (event) -> event.stopPropagation()
, ,
"title": "New Comment" "title": "New Comment"
"class": "commenter-icon" "class": "commenter-icon"
...@@ -45,6 +48,7 @@ class Annotator.Plugin.Toolbar extends Annotator.Plugin ...@@ -45,6 +48,7 @@ class Annotator.Plugin.Toolbar extends Annotator.Plugin
event.preventDefault() event.preventDefault()
event.stopPropagation() event.stopPropagation()
window.annotator.addComment() window.annotator.addComment()
"mouseup": (event) -> event.stopPropagation()
] ]
pluginInit: -> pluginInit: ->
...@@ -59,6 +63,7 @@ class Annotator.Plugin.Toolbar extends Annotator.Plugin ...@@ -59,6 +63,7 @@ class Annotator.Plugin.Toolbar extends Annotator.Plugin
.attr('href', '') .attr('href', '')
.attr('title', item.title) .attr('title', item.title)
.on('click', item.click) .on('click', item.click)
.on('mouseup', item.mouseup)
.addClass(item.class) .addClass(item.class)
button = $('<li></li>').append(anchor) button = $('<li></li>').append(anchor)
buttons.add button buttons.add button
......
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