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
81807551
Commit
81807551
authored
Dec 02, 2014
by
Randall Leeds
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1729 from hypothesis/1728-drop-shadows
Re-implement hiliting annotation cards on hover
parents
eae9958d
c50817f8
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
34 additions
and
4 deletions
+34
-4
controllers.coffee
h/static/scripts/controllers.coffee
+2
-0
guest.coffee
h/static/scripts/guest.coffee
+20
-2
services.coffee
h/static/scripts/services.coffee
+8
-0
threads.scss
h/static/styles/threads.scss
+3
-2
viewer.html
h/templates/client/viewer.html
+1
-0
No files found.
h/static/scripts/controllers.coffee
View file @
81807551
...
...
@@ -353,6 +353,8 @@ class ViewerController
else
true
$scope
.
isFocused
=
(
annotation
)
->
annotation
?
.
$
$tag
in
(
$scope
.
focusedAnnotations
?
[])
angular
.
module
(
'h'
)
.
controller
(
'AppController'
,
AppController
)
...
...
h/static/scripts/guest.coffee
View file @
81807551
...
...
@@ -250,8 +250,11 @@ class Annotator.Guest extends Annotator
method
:
"showEditor"
params
:
annotation
.
$
$tag
onAnchorMouseover
:
->
onAnchorMouseout
:
->
focusInViewer
:
(
annotations
)
=>
@
panel
?
.
notify
method
:
"setViewerFocus"
params
:
(
a
.
$
$tag
for
a
in
annotations
)
onAnchorMousedown
:
->
checkForStartSelection
:
(
event
)
=>
...
...
@@ -294,6 +297,21 @@ class Annotator.Guest extends Annotator
# Tell sidebar to show the viewer for these annotations
this
.
showViewer
annotations
# When hovering on a highlight in highlighting mode,
# tell the sidebar to hilite the relevant annotations
onAnchorMouseover
:
(
event
)
->
if
@
visibleHighlights
or
@
tool
is
'highlight'
event
.
stopPropagation
()
annotations
=
event
.
data
.
getAnnotations
(
event
)
this
.
focusInViewer
annotations
# When leaving a highlight (with the cursor) in highlighting mode,
# tell the sidebar to stop hiliting the relevant annotations
onAnchorMouseout
:
(
event
)
->
if
@
visibleHighlights
or
@
tool
is
'highlight'
event
.
stopPropagation
()
this
.
focusInViewer
[]
# When clicking on a highlight in highlighting mode,
# tell the sidebar to bring up the viewer for the relevant annotations
onAnchorClick
:
(
event
)
=>
...
...
h/static/scripts/services.coffee
View file @
81807551
...
...
@@ -164,6 +164,11 @@ class Hypothesis extends Annotator
this
.
updateViewer
this
.
_getLocalAnnotations
(
tags
)
)
.
bind
(
'setViewerFocus'
,
(
ctx
,
tags
=
[])
=>
@
element
.
scope
().
$apply
=>
this
.
setViewerFocus
tags
)
.
bind
(
'toggleViewerSelection'
,
(
ctx
,
tags
=
[])
=>
@
element
.
scope
().
$apply
=>
this
.
toggleViewerSelection
this
.
_getLocalAnnotations
(
tags
)
...
...
@@ -231,6 +236,9 @@ class Hypothesis extends Annotator
@
_setSelectedAnnotations
selected
this
setViewerFocus
:
(
tags
)
->
@
element
.
scope
().
focusedAnnotations
=
tags
updateViewer
:
(
annotations
=
[])
->
# TODO: re-implement
this
...
...
h/static/styles/threads.scss
View file @
81807551
...
...
@@ -6,8 +6,9 @@ $threadexp-width: .6em;
margin-bottom
:
.72em
;
}
.card-emphasis
{
box-shadow
:
6px
6px
8px
-2px
$gray-light
;
&
>
li
.thread
:hover
,
&
>
li
.thread.js-hover
{
@include
focus-outline
;
}
}
...
...
h/templates/client/viewer.html
View file @
81807551
...
...
@@ -34,6 +34,7 @@
</span>
</li>
<li
class=
"paper thread"
ng-class=
"{'js-hover': isFocused(child.message)}"
deep-count=
"count"
thread=
"child"
thread-filter
thread-collapsed=
"!search.query"
...
...
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