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

Add GOVUK.ShowHideContent JavaScript #315

Merged
merged 12 commits into from
Sep 5, 2016

Commits on Aug 22, 2016

  1. Add GOVUK.ShowHideContent

    colinrotherham authored and gemmaleigh committed Aug 22, 2016
    Configuration menu
    Copy the full SHA
    1c0db7f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    51de396 View commit details
    Browse the repository at this point in the history
  3. Slight performance tweak to GOVUK.ShowHideContent

    Avoid DOM parentNode traversal (after init, `aria-controls` attribute can be used instead).
    colinrotherham authored and gemmaleigh committed Aug 22, 2016
    Configuration menu
    Copy the full SHA
    ba6936e View commit details
    Browse the repository at this point in the history
  4. Use Standard to format JS

    gemmaleigh committed Aug 22, 2016
    Configuration menu
    Copy the full SHA
    77268de View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    cbbcb38 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    63362d8 View commit details
    Browse the repository at this point in the history

Commits on Aug 23, 2016

  1. Configuration menu
    Copy the full SHA
    6caa441 View commit details
    Browse the repository at this point in the history
  2. Run handleRadioContent only on controlling radios

    This reduces the radios we are trying to hide the
    content for to only be those which are controls.
    
    This covers the following use cases:
    
    1. If the control sent in is not a control
    
    All content controlled by radios in this group
    will be hidden.
    
    2. If the control sent in is a control
    
    All content controlled by radios in this group
    will be hidden and the content for the control
    will be shown.
    tombye committed Aug 23, 2016
    Configuration menu
    Copy the full SHA
    3999832 View commit details
    Browse the repository at this point in the history
  3. Add fixes for standard JS errors

    The following errors came up:
    
    - 80:54: Block must not be padded by blank lines.
    - 105:12: Closing curly brace does not appear on
      the same line as the subsequent block.
    tombye committed Aug 23, 2016
    Configuration menu
    Copy the full SHA
    9d9b3c6 View commit details
    Browse the repository at this point in the history

Commits on Aug 24, 2016

  1. Re-point paths to jasmine runner files

    They were rewritten to point at a local version of
    jasmine-core but this is not listed in our
    package.json so only exists in /node_modules as a
    dependency of grunt-contrib-jasmine.
    tombye committed Aug 24, 2016
    Configuration menu
    Copy the full SHA
    91a8ed7 View commit details
    Browse the repository at this point in the history
  2. Only bind events to controlling selection buttons

    At the moment the ShowHideContent module binds
    events to all radios and checkboxes in
    block-labels. This mean a user clicking on any
    block-label in the page will trigger code to
    show/hide its related content, even if there is
    none.
    
    This commit limits the block-labels that trigger
    the code to show/hide content related to it to
    those that have that relationship.
    tombye committed Aug 24, 2016
    Configuration menu
    Copy the full SHA
    420b23d View commit details
    Browse the repository at this point in the history
  3. Remove parenthesis from return expression

    The `result` variable will always be a string
    (rather than an expression) so doesn't need
    parenthesis.
    tombye committed Aug 24, 2016
    Configuration menu
    Copy the full SHA
    a8ae9ee View commit details
    Browse the repository at this point in the history