govuk_frontend_toolkit
Advanced tools
Comparing version 1.4.0 to 1.5.0
@@ -10,4 +10,4 @@ module.exports = function(grunt) { | ||
options: { | ||
specs: 'spec/*Spec.js', | ||
helpers: 'spec/*Helper.js' | ||
specs: 'spec/unit/*Spec.js', | ||
helpers: 'spec/unit/*Helper.js' | ||
} | ||
@@ -14,0 +14,0 @@ } |
@@ -51,2 +51,8 @@ # GOV.UK Frontend Toolkit | ||
### Using the local test runner | ||
The test suite can be run by opening the `./spec/support/LocalTestRunner.html` file in a browser for a more detailed trace of errors. | ||
The files for unit tests and any supporting JavaScript should be added to `./spec/manifest.js` file. | ||
## Usage | ||
@@ -826,5 +832,23 @@ | ||
## Selection buttons | ||
Script to support a specific design of radio buttons and checkboxes wrapped in `<label>` tags: | ||
<label> | ||
<input type="radio" name="size" value="medium" /> | ||
</label> | ||
When the input is focused or its `checked` attribute is set, classes are added to their parent labels so their styling can show this. | ||
To apply this behaviour to elements with the above HTML pattern, call the `GOVUK.selectionButtons` function with their inputs: | ||
``` | ||
var $buttons = $("label input[type='radio'], label input[type='checkbox']"); | ||
GOVUK.selectionButtons($buttons); | ||
``` | ||
Note that `GOVUK.selectionButtons` and the constructors it wraps, `GOVUK.RadioButtons` and `GOVUK.CheckboxButtons` use the `bind.js` polyfill. | ||
## Licence | ||
Released under the MIT Licence, a copy of which can be found in the file `LICENCE`. |
{ | ||
"name": "govuk_frontend_toolkit", | ||
"version": "1.4.0", | ||
"version": "1.5.0", | ||
"description": "npm for govuk_frontend_toolkit", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
475862
168
1343
1