• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

hypothesis / h / 5726
55%
master: 97%

Build:
Build:
LAST BUILD BRANCH: realtime-update-v1-h-only-1
DEFAULT BRANCH: master
Ran 01 Apr 2015 06:09PM UTC
Jobs 1
Files 60
Run time 3s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
5726

push

travis-ci

seanh
Automatically scroll to new annotations

When the user adds a new annotation scroll the sidebar to show it.

The way this has been implemented causes annotations to be scrolled to
when their edit buttons are clicked as well, not just when new
annotations are created, which causes things to jump around confusingly
when clicking edit buttons. This needs to be fixed.

This fixes #2053 - in cases when there are more than a screenful of
annotations in the sidebar, creating a new annotation causes a new
annotation to appear in the sidebar but this may happen off screen
leaving the user confused. (For example: scroll to the very bottom of
the sidebar then create a new annotation at the top of the page, or
vice-versa.) The fix is to scroll the sidebar to show the new
annotation.

The diff for annotation.html is a mess - we've only actually changed a
couple of things, but we had to change the indentation of the while file
so git thinks we changed everything.

- We use #fragment links to scroll to the new annotations.
- This requires the HTML elements for the annotations to have unique id
  attributes.
- We can't use the IDs of the annotations from the server because new
  annotations that haven't been saved don't have IDs yet.
- So instead we use timestamps.
- We use a new scrolltome directive that scrolls the page to its element
  when instantiated.
- We attach this scrolltome directive to an element within the
  annotation that has ng-if="vm.editing", whenever this expression
  becomes true the directive will be instantiated and cause a scroll.
  The expression is true when new annotations are added.
- We wrap the HTML for an annotation in a new div to hold the id that
  we're going to link to. We need an element that contains all of the
  HTML for the annotation so that the whole annotation is always
  scrolled into view, whether we're scrolling up or down to get to it.
  We can't use the outermost <article> of the annotation in thread.html
  because that's... (continued)

1367 of 2498 relevant lines covered (54.72%)

0.55 hits per line

Jobs
ID Job ID Ran Files Coverage
1 5726.1 (BROWSERIFY_PIPE_BIN=bin/browserify-pipe) 01 Apr 2015 06:09PM UTC 0
54.72
Travis Job 5726.1
Source Files on build 5726
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #5726
  • 9431f026 on github
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc