Includes:
- change .stopped method to .isStopped() for
consistency
- replace code in checkResize that adjusts
dimensions for setElementDimensions
- add code that deals with the window size being
too small to run whenever positions are calculated
- add reset method for when screen is too small
for sticking behaviour
- move guard out of methods for stopping and
sticking (it hid info that was useful at the
point they were called)
Allows other JS to tell sticky elements to
recalculate their dimensions and then position
(and then check to see if their state needs
changing).
We need this because we change the content of our
element so its dimensions change.
The recalculation code also updates the shim for
elements that are 'stuck' so the horizontal space
the element would occupy in the flow of the page
is correct.
Includes other code that splits the height
StickyElement stores into two properties:
1. `verticalSpace`
2. `height`
`verticalSpace` is the vertical space the element
occupies in the document flow when not stuck.
`height` is the visual space of the element,
including padding and border.
Changes the check to say ‘does the user have any live services’ rather
than ‘are all their services in trial mode’. The former is closer to
meaning the thing we care about.
Also has the opportunity to short-circuit without having to go through
the full list.
Only users who work for government can accept the terms of use. This
will save us from having to email these requesters back telling them
they need to find someone else to submit the request.
We suggest people format their numbers with commas when telling us how
many things they’re going to send.
This causes problems when we paste these values into a spreadsheet,
because the commas get interpreted as column separators.
This is better because it saves vertical space for the contents of the
pop-up menu.
This commit also adds some padding to the cancel and clear buttons, to
make them easier targets to hit.
Being able to see how many things you have selected gives you positive
feedback that reinforces that what you’ve done has been recognised. It
helps you understand the implications of your actions (ie you see ‘3
selected’ before you press the ‘Move’ button). And it gives you an
escape hatch the get out of the state you’re in by providing the ‘Clear’
button.
We also found in prototyping that having a ‘Nothing selected’ message
helps draws people’s attention to the checkboxes when they first
encounter the folders feature.
This commit implements the counter and the cancel button. It tries to
follow the existing patterns for this module.
We ‘shim’ the sticky element so that its space in the page is reserved
while it is sticky.
This means the shim have have the same height as the sticky element.
It’s height was not getting set because of a missing semicolon in the
shim element’s `style` attribute.
Otherwise we can end up collecting invalid email addresses…
This required some refactoring to allow our email fields to be optional
(but not by default).
We adjust the spacing under the textbox when doing the send one off
flow. This was based on the assumption that there would always be a
sticky header in the send one off flow.
This assumption is no longer true, so this commit implements the same
spacing in an independent way.