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

alphagov / notifications-admin / 3563
86%
master: 94%

Build:
Build:
LAST BUILD BRANCH: fix-days-provider-history
DEFAULT BRANCH: master
Ran 14 Jun 2016 02:29PM UTC
Jobs 1
Files 54
Run time 4s
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
3563

push

travis-ci

quis
Stop page jumping on first load with a long email

A long email message needs to be collapsed to only show the first few
lines. The problem is that we were doing this by adding a class with
Javascript, meaning that the email wasn’t being collapsed until the
script in the footer ran.

This caused a jump in the page because the browser was painting the
whole email message, then repainting it once it was collapsed.

This commit takes advantage of the `.js-enabled` class added to the
`<body>` by a script in the `<head>` of GOV.UK template.

This means that the email message is collapsed with CSS before the first
paint of the page, so no jump.

This introduces some complexity in how we determine which emails get the
expander toggle. Because they’re already collapsed we can’t get their
height and work out if they’re long enough to need collapsing.

So we need to take a copy of the message, put it off-screen, expand it,
get its height, then remove it from the DOM. Bit of a faff.

Because of this there’s still a quick flash of the toggle if you see an
email message that’s too short to need collapsing. I think this is the
lesser of two evils—very short email messages will be few and far
between in the real world.

1893 of 2195 relevant lines covered (86.24%)

0.86 hits per line

Jobs
ID Job ID Ran Files Coverage
1 3563.1 (auth_token=[secure]) 14 Jun 2016 02:29PM UTC 0
86.24
Travis Job 3563.1
Source Files on build 3563
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #3563
  • 884ce443 on github
  • Next Build on no-jump-email (#3570)
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