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
643be4a4
Commit
643be4a4
authored
Apr 08, 2015
by
Randall Leeds
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2138 from hypothesis/UX-Improvements
Address usability issues
parents
d028e3ba
77b25b42
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
49 deletions
+9
-49
toolbar.coffee
h/static/scripts/annotator/plugin/toolbar.coffee
+8
-13
inject.scss
h/static/styles/inject.scss
+0
-35
variables.scss
h/static/styles/variables.scss
+1
-1
No files found.
h/static/scripts/annotator/plugin/toolbar.coffee
View file @
643be4a4
...
...
@@ -10,14 +10,10 @@ makeButton = (item) ->
return
button
[
0
]
class
Annotator
.
Plugin
.
Toolbar
extends
Annotator
.
Plugin
PUSHED_CLASS
=
'annotator-pushed'
events
:
'.annotator-toolbar mouseenter'
:
'show'
'.annotator-toolbar mouseleave'
:
'hide'
'setVisibleHighlights'
:
'onSetVisibleHighlights'
html
:
'<div class="annotator-toolbar
annotator-hide
"></div>'
html
:
'<div class="annotator-toolbar"></div>'
pluginInit
:
->
@
annotator
.
toolbar
=
@
toolbar
=
$
(
@
html
)
...
...
@@ -39,7 +35,7 @@ class Annotator.Plugin.Toolbar extends Annotator.Plugin
else
@
annotator
.
triggerHideFrame
()
,
"title"
:
"
Show Annotation
s"
"title"
:
"
Hide Highlight
s"
"class"
:
"h-icon-visibility"
"on"
:
"click"
:
(
event
)
=>
...
...
@@ -67,16 +63,15 @@ class Annotator.Plugin.Toolbar extends Annotator.Plugin
# psuedo-class to a clicked element.
@
toolbar
.
on
(
'mouseup'
,
'a'
,
(
event
)
->
$
(
event
.
target
).
blur
())
show
:
->
this
.
toolbar
.
removeClass
(
'annotator-hide'
)
hide
:
->
this
.
toolbar
.
addClass
(
'annotator-hide'
)
onSetVisibleHighlights
:
(
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
$
(
@
buttons
[
1
]).
removeClass
(
PUSHED_CLASS
)
this
.
_updateStickyButtons
()
$
(
@
buttons
[
1
]).
children
().
removeClass
(
'h-icon-visibility'
)
$
(
@
buttons
[
1
]).
children
().
addClass
(
'h-icon-visibility-off'
)
$
(
@
buttons
[
1
]).
children
().
prop
(
'title'
,
'Show Highlights'
);
_updateStickyButtons
:
->
count
=
$
(
@
buttons
).
filter
(
->
$
(
this
).
hasClass
(
PUSHED_CLASS
)).
length
...
...
h/static/styles/inject.scss
View file @
643be4a4
...
...
@@ -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
{
@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
;
border
:
solid
1px
$gray-lighter
;
border-radius
:
4px
;
...
...
@@ -201,16 +176,6 @@ $base-font-size: 14px;
z-index
:
1
;
}
&
.annotator-pushed
{
@include
box-shadow
(
none
);
left
:
3px
;
z-index
:
1
;
a
{
color
:
$text-color
;
}
}
a
{
@include
single-transition
(
background-color
,
.25s
,
.25s
);
background
:
$white
;
...
...
h/static/styles/variables.scss
View file @
643be4a4
...
...
@@ -57,7 +57,7 @@ $bucket-bar-width: 22px;
$highlight-color
:
rgba
(
255
,
255
,
60
,
0
.3
);
$highlight-color-second
:
rgba
(
206
,
206
,
60
,
0
.4
);
$highlight-color-third
:
rgba
(
192
,
192
,
49
,
0
.4
);
$highlight-color-focus
:
rgb
(
224
,
246
,
254
);
$highlight-color-focus
:
rgb
a
(
156
,
230
,
255
,
0
.5
);
$score-width
:
40px
;
$score-height
:
$score-width
;
$input-border-radius
:
2px
;
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