Commit 983c9d8a authored by Aron Carroll's avatar Aron Carroll Committed by Aron Carroll

Remove focus state when clicking on toolbar buttons

This prevents the focus style continuing to be applied after a toolbar
button has been clicked.
parent fb02e7bc
...@@ -39,10 +39,6 @@ class Annotator.Plugin.Toolbar extends Annotator.Plugin ...@@ -39,10 +39,6 @@ class Annotator.Plugin.Toolbar extends Annotator.Plugin
@annotator.showFrame() @annotator.showFrame()
else else
@annotator.hideFrame() @annotator.hideFrame()
# Remove focus from the anchor when clicked, this removes the focus
# styles intended only for keyboard navigation. IE/FF apply the focus
# psuedo-class to a clicked element.
"mouseup": (event) -> $(event.target).blur()
, ,
"title": "Show Annotations" "title": "Show Annotations"
"class": "h-icon-visible" "class": "h-icon-visible"
...@@ -77,6 +73,11 @@ class Annotator.Plugin.Toolbar extends Annotator.Plugin ...@@ -77,6 +73,11 @@ class Annotator.Plugin.Toolbar extends Annotator.Plugin
@buttons.appendTo(list) @buttons.appendTo(list)
@toolbar.append(list) @toolbar.append(list)
# Remove focus from the anchors when clicked, this removes the focus
# styles intended only for keyboard navigation. IE/FF apply the focus
# psuedo-class to a clicked element.
@toolbar.on('mouseup', 'a', (event) -> $(event.target).blur())
show: -> this.toolbar.removeClass('annotator-hide') show: -> this.toolbar.removeClass('annotator-hide')
hide: -> this.toolbar.addClass('annotator-hide') hide: -> this.toolbar.addClass('annotator-hide')
...@@ -104,4 +105,4 @@ class Annotator.Plugin.Toolbar extends Annotator.Plugin ...@@ -104,4 +105,4 @@ class Annotator.Plugin.Toolbar extends Annotator.Plugin
height = 35 height = 35
this.toolbar.css("min-height", "") this.toolbar.css("min-height", "")
this.annotator.plugins.BucketBar?.BUCKET_THRESHOLD_PAD = height this.annotator.plugins.BucketBar?.BUCKET_THRESHOLD_PAD = height
this.annotator.plugins.BucketBar?._update(); this.annotator.plugins.BucketBar?._update()
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