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
b5376aab
Commit
b5376aab
authored
May 13, 2015
by
Randall Leeds
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add scrollables option to the BucketBar
parent
dec29271
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
main.js
h/static/scripts/annotator/main.js
+2
-1
bucket-bar.coffee
h/static/scripts/annotator/plugin/bucket-bar.coffee
+12
-1
No files found.
h/static/scripts/annotator/main.js
View file @
b5376aab
...
@@ -31,13 +31,14 @@ require('./plugin/textselection');
...
@@ -31,13 +31,14 @@ require('./plugin/textselection');
var
docs
=
'https://h.readthedocs.org/en/latest/hacking/customized-embedding.html'
;
var
docs
=
'https://h.readthedocs.org/en/latest/hacking/customized-embedding.html'
;
var
options
=
{
var
options
=
{
app
:
jQuery
(
'link[type="application/annotator+html"]'
).
attr
(
'href'
),
app
:
jQuery
(
'link[type="application/annotator+html"]'
).
attr
(
'href'
),
BucketBar
:
{
container
:
'.annotator-frame'
},
BucketBar
:
{
container
:
'.annotator-frame'
,
scrollables
:
[
'body'
]
},
Toolbar
:
{
container
:
'.annotator-frame'
}
Toolbar
:
{
container
:
'.annotator-frame'
}
};
};
// Document metadata plugins
// Document metadata plugins
if
(
window
.
PDFViewerApplication
)
{
if
(
window
.
PDFViewerApplication
)
{
require
(
'./plugin/pdf'
)
require
(
'./plugin/pdf'
)
options
[
'BucketBar'
][
'scrollables'
]
=
[
'#viewerContainer'
]
options
[
'PDF'
]
=
{};
options
[
'PDF'
]
=
{};
}
else
{
}
else
{
require
(
'../vendor/annotator.document'
);
require
(
'../vendor/annotator.document'
);
...
...
h/static/scripts/annotator/plugin/bucket-bar.coffee
View file @
b5376aab
...
@@ -60,6 +60,9 @@ class Annotator.Plugin.BucketBar extends Annotator.Plugin
...
@@ -60,6 +60,9 @@ class Annotator.Plugin.BucketBar extends Annotator.Plugin
# then that annotation will not be merged into the bucket
# then that annotation will not be merged into the bucket
gapSize
:
60
gapSize
:
60
# Selectors for the scrollable elements on the page
scrollables
:
null
# buckets of annotations that overlap
# buckets of annotations that overlap
buckets
:
[]
buckets
:
[]
...
@@ -86,7 +89,15 @@ class Annotator.Plugin.BucketBar extends Annotator.Plugin
...
@@ -86,7 +89,15 @@ class Annotator.Plugin.BucketBar extends Annotator.Plugin
@
annotator
.
subscribe
event
,
this
.
_scheduleUpdate
@
annotator
.
subscribe
event
,
this
.
_scheduleUpdate
$
(
window
).
on
'resize scroll'
,
this
.
_scheduleUpdate
$
(
window
).
on
'resize scroll'
,
this
.
_scheduleUpdate
$
(
document
.
body
).
on
'resize scroll'
,
'*'
,
this
.
_scheduleUpdate
for
scrollable
in
@
options
.
scrollables
?
[]
$
(
scrollable
).
on
'resize scroll'
,
this
.
_scheduleUpdate
destroy
:
->
$
(
window
).
off
'resize scroll'
,
this
.
_scheduleUpdate
for
scrollable
in
@
options
.
scrollables
?
[]
$
(
scrollable
).
off
'resize scroll'
,
this
.
_scheduleUpdate
# Update sometime soon
# Update sometime soon
_scheduleUpdate
:
=>
_scheduleUpdate
:
=>
...
...
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