Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Annotate/Highlight dialogue box detached from selected text #619

Closed
dhimmel opened this issue Dec 2, 2017 · 4 comments
Closed

Annotate/Highlight dialogue box detached from selected text #619

dhimmel opened this issue Dec 2, 2017 · 4 comments

Comments

@dhimmel
Copy link

dhimmel commented Dec 2, 2017

We're interested in using the hypothesis javascript client for our Manubot HTML pages (manubot/rootstock#90). We want to apply Hypothesis to pages like https://greenelab.github.io/manubot-rootstock/.

However, when we add Hypothesis like https://via.hypothes.is/https://greenelab.github.io/manubot-rootstock/, there's an issue with the dialogue box placement:

hypothesis

The annotation options appear far away from the actual point of highlighting. Not sure whether this is an issue with our CSS or a Hypothesis client issue. Hat tip to @RaoOfPhysics for bringing this issue to our attention.

@dsiddy
Copy link
Contributor

dsiddy commented Dec 3, 2017

@dhimmel, thanks for the heads-up. When I set margin-left: 0 on your website's html element, the Hypothesis adder appears in the correct position, so I'm guessing there's something similar to #487 at work here. (The relevant file, for troubleshooting's sake, is src/annotator/adder.js.)

@dhimmel
Copy link
Author

dhimmel commented Dec 4, 2017

Thanks @dsiddy. I'm interested in the potential fix you've discovered.

Our CSS currently includes.

/***Page margins when printing***/
@page { 
    margin-top: 19mm;
    margin-bottom: 16mm;
    margin-left: 0mm;
    margin-right: 0mm;
}

However, the @page presumably only affects the printed document. Do you have a suggestion for how we would change our CSS for Hypothesis to work?

P.S. feel free to submit a PR to Manubot, if you feel so inclined.

@dsiddy
Copy link
Contributor

dsiddy commented Dec 7, 2017

Sorry for the belated reply, @dhimmel. I just accepted your invitation and submitted a pull request (manubot/rootstock#95) that should resolve the issue.

dhimmel pushed a commit to manubot/rootstock that referenced this issue Dec 7, 2017
By positioning the `body` element, we tell Hypothesis to use it (rather
than the document) as the container element for the adder. (See
hypothesis/client#487 for more information.)

Closes: #90, hypothesis/client#619
@dhimmel
Copy link
Author

dhimmel commented Dec 7, 2017

Closed in manubot/rootstock@d209731. Thanks @dsiddy for the fix!

@dhimmel dhimmel closed this as completed Dec 7, 2017
adebali pushed a commit to CompGenomeLab/lemur-manuscript-archive that referenced this issue Mar 4, 2020
By positioning the `body` element, we tell Hypothesis to use it (rather
than the document) as the container element for the adder. (See
hypothesis/client#487 for more information.)

Closes: #90, hypothesis/client#619
ploegieku added a commit to ploegieku/2023-functional-homology-paper that referenced this issue Aug 6, 2024
By positioning the `body` element, we tell Hypothesis to use it (rather
than the document) as the container element for the adder. (See
hypothesis/client#487 for more information.)

Closes: #90, hypothesis/client#619
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants