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
77503e7a
Commit
77503e7a
authored
Apr 15, 2013
by
Randall Leeds
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
track frame visibility only in the scope
fixes #376
parent
384bf038
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
7 deletions
+9
-7
controllers.coffee
h/js/controllers.coffee
+7
-4
services.coffee
h/js/services.coffee
+2
-3
No files found.
h/js/controllers.coffee
View file @
77503e7a
class
App
scope
:
frame
:
visible
:
false
username
:
null
email
:
null
password
:
null
...
...
@@ -39,7 +41,8 @@ class App
{
highlights
,
offset
}
=
elem
.
datum
()
if
dynamicBucket
and
$location
.
path
()
==
'/viewer'
and
annotator
.
visible
visible
=
$scope
.
frame
.
visible
if
dynamicBucket
and
visible
and
$location
.
path
()
==
'/viewer'
bottom
=
offset
+
heatmap
.
element
.
height
()
annotations
=
highlights
.
reduce
(
acc
,
hl
)
=>
if
hl
.
offset
.
top
>=
offset
and
hl
.
offset
.
top
<=
bottom
...
...
@@ -151,7 +154,7 @@ class App
annotator
.
plugins
.
Store
.
pluginInit
()
dynamicBucket
=
true
$scope
.
$watch
'visible'
,
(
newValue
)
->
$scope
.
$watch
'
frame.
visible'
,
(
newValue
)
->
if
newValue
then
annotator
.
show
()
else
annotator
.
hide
()
$scope
.
$on
'back'
,
->
...
...
@@ -159,7 +162,7 @@ class App
if
$location
.
path
()
==
'/viewer'
and
$location
.
search
()
?
.
id
?
$location
.
search
(
'id'
,
null
).
replace
()
else
$scope
.
visible
=
false
annotator
.
hide
()
$scope
.
$on
'showAuth'
,
(
event
,
show
=
true
)
->
angular
.
extend
$scope
.
sheet
,
...
...
@@ -331,7 +334,7 @@ class Viewer
listening
=
false
refresh
=
=>
return
unless
annotator
.
visible
return
unless
$scope
.
frame
.
visible
this
.
refresh
$scope
,
$routeParams
,
annotator
if
listening
if
$scope
.
detail
...
...
h/js/services.coffee
View file @
77503e7a
...
...
@@ -40,7 +40,6 @@ class Hypothesis extends Annotator
Threading
:
{}
# Internal state
visible
:
false
# * Whether the sidebar is visible
dragging
:
false
# * To enable dragging only when we really want to
# Here as a noop just to make the Permissions plugin happy
...
...
@@ -284,14 +283,14 @@ class Hypothesis extends Annotator
this
show
:
=>
@
visible
=
true
@
element
.
scope
().
frame
.
visible
=
true
@
provider
.
notify
method
:
'showFrame'
@
element
.
find
(
'#toolbar'
).
addClass
(
'shown'
)
.
find
(
'.tri'
).
attr
(
'draggable'
,
true
)
hide
:
=>
@
lastWidth
=
window
.
innerWidth
@
visible
=
false
@
element
.
scope
().
frame
.
visible
=
false
@
provider
.
notify
method
:
'setActiveHighlights'
@
provider
.
notify
method
:
'hideFrame'
@
element
.
find
(
'#toolbar'
).
removeClass
(
'shown'
)
...
...
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