govuk_frontend_toolkit
Advanced tools
Comparing version 0.43.1 to 0.44.0
@@ -658,3 +658,3 @@ # GOV.UK Frontend Toolkit | ||
If you have a complex test, it may be worth extending MultivariateTest with | ||
If you have a complex test, it may be worth extending MultivariateTest with | ||
your own. Callbacks can be strings which will call a method of that name | ||
@@ -673,5 +673,34 @@ on the current object. | ||
## Primary Links | ||
`GOVUK.PrimaryList` hides elements in a list which don't have a supplied | ||
selector, they will then be shown when the user clicks. `GOVUK.primaryLinks` is | ||
a helper to add this behaviour to many elements. | ||
Example markup: | ||
```html | ||
<ul id="primary-list"> | ||
<li class="primary-item">Item 1</li> | ||
<li>Item 2</li> | ||
<li>Item 3</li> | ||
</ul> | ||
``` | ||
To add it to all lists which have items with the class `primary-item` use | ||
something like: | ||
```javascript | ||
GOVUK.primaryLinks.init('.primary-item'); | ||
``` | ||
Or to add it just to that list you could use: | ||
```javascript | ||
new GOVUK.PrimaryList($('#primary-list'), '.primary-item'); | ||
``` | ||
## Licence | ||
Released under the MIT Licence, a copy of which can be found in the file `LICENCE`. |
{ | ||
"name": "govuk_frontend_toolkit", | ||
"version": "0.43.1", | ||
"version": "0.44.0", | ||
"description": "npm for govuk_frontend_toolkit", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
424677
136
551