Commit 7a0d1ea9 authored by Jake Hartnell's avatar Jake Hartnell

Address usability issues

- Toolbar always open
- Show anotations changes icon and tooltip when toggled.
- .annotator-h1-focused color darkened
parent 1a4268be
...@@ -13,11 +13,9 @@ class Annotator.Plugin.Toolbar extends Annotator.Plugin ...@@ -13,11 +13,9 @@ class Annotator.Plugin.Toolbar extends Annotator.Plugin
PUSHED_CLASS = 'annotator-pushed' PUSHED_CLASS = 'annotator-pushed'
events: events:
'.annotator-toolbar mouseenter': 'show'
'.annotator-toolbar mouseleave': 'hide'
'setVisibleHighlights': 'onSetVisibleHighlights' 'setVisibleHighlights': 'onSetVisibleHighlights'
html: '<div class="annotator-toolbar annotator-hide"></div>' html: '<div class="annotator-toolbar"></div>'
pluginInit: -> pluginInit: ->
@annotator.toolbar = @toolbar = $(@html) @annotator.toolbar = @toolbar = $(@html)
...@@ -39,7 +37,7 @@ class Annotator.Plugin.Toolbar extends Annotator.Plugin ...@@ -39,7 +37,7 @@ class Annotator.Plugin.Toolbar extends Annotator.Plugin
else else
@annotator.triggerHideFrame() @annotator.triggerHideFrame()
, ,
"title": "Show Annotations" "title": "Hide Highlights"
"class": "h-icon-visibility" "class": "h-icon-visibility"
"on": "on":
"click": (event) => "click": (event) =>
...@@ -67,16 +65,15 @@ class Annotator.Plugin.Toolbar extends Annotator.Plugin ...@@ -67,16 +65,15 @@ class Annotator.Plugin.Toolbar extends Annotator.Plugin
# psuedo-class to a clicked element. # psuedo-class to a clicked element.
@toolbar.on('mouseup', 'a', (event) -> $(event.target).blur()) @toolbar.on('mouseup', 'a', (event) -> $(event.target).blur())
show: -> this.toolbar.removeClass('annotator-hide')
hide: -> this.toolbar.addClass('annotator-hide')
onSetVisibleHighlights: (state) -> onSetVisibleHighlights: (state) ->
if state if state
$(@buttons[1]).addClass(PUSHED_CLASS) $(@buttons[1]).children().removeClass('h-icon-visibility-off')
$(@buttons[1]).children().addClass('h-icon-visibility')
$(@buttons[1]).children().prop('title', 'Hide Highlights');
else else
$(@buttons[1]).removeClass(PUSHED_CLASS) $(@buttons[1]).children().removeClass('h-icon-visibility')
this._updateStickyButtons() $(@buttons[1]).children().addClass('h-icon-visibility-off')
$(@buttons[1]).children().prop('title', 'Show Highlights');
_updateStickyButtons: -> _updateStickyButtons: ->
count = $(@buttons).filter(-> $(this).hasClass(PUSHED_CLASS)).length count = $(@buttons).filter(-> $(this).hasClass(PUSHED_CLASS)).length
......
...@@ -152,33 +152,8 @@ $base-font-size: 14px; ...@@ -152,33 +152,8 @@ $base-font-size: 14px;
} }
} }
.annotator-frame .annotator-toolbar.annotator-hide {
display: block;
visibility: visible;
li {
@include transition-delay(.75s);
@include transition-timing-function(cubic-bezier(1, .1, .55, 0));
height: 0;
left: 34px;
margin-top: -2px;
&:first-child, &.annotator-pushed {
@include transition-delay(0);
left: 3px;
height: 30px;
}
&.annotator-pushed {
margin-top: 5px;
}
}
}
.annotator-frame .annotator-toolbar li { .annotator-frame .annotator-toolbar li {
@include smallshadow; @include smallshadow;
@include transition-property(left, height, margin-top);
@include transition-duration(.25s);
@include transition-delay(0);
@include transition-timing-function(cubic-bezier(0, .55, .1, 1));
background: $white; background: $white;
border: solid 1px $gray-lighter; border: solid 1px $gray-lighter;
border-radius: 4px; border-radius: 4px;
...@@ -201,16 +176,6 @@ $base-font-size: 14px; ...@@ -201,16 +176,6 @@ $base-font-size: 14px;
z-index: 1; z-index: 1;
} }
&.annotator-pushed {
@include box-shadow(none);
left: 3px;
z-index: 1;
a {
color: $text-color;
}
}
a { a {
@include single-transition(background-color, .25s, .25s); @include single-transition(background-color, .25s, .25s);
background: $white; background: $white;
......
...@@ -57,7 +57,7 @@ $bucket-bar-width: 22px; ...@@ -57,7 +57,7 @@ $bucket-bar-width: 22px;
$highlight-color: rgba(255, 255, 60, 0.3); $highlight-color: rgba(255, 255, 60, 0.3);
$highlight-color-second: rgba(206, 206, 60, 0.4); $highlight-color-second: rgba(206, 206, 60, 0.4);
$highlight-color-third: rgba(192, 192, 49, 0.4); $highlight-color-third: rgba(192, 192, 49, 0.4);
$highlight-color-focus: rgb(224, 246, 254); $highlight-color-focus: rgba(156, 230, 255, 0.5);
$score-width: 40px; $score-width: 40px;
$score-height: $score-width; $score-height: $score-width;
$input-border-radius: 2px; $input-border-radius: 2px;
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