govuk_publishing_components 28.6.0 → 28.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/app/assets/javascripts/govuk_publishing_components/components/feedback.js +7 -6
- data/app/assets/javascripts/govuk_publishing_components/vendor/lux/lux-reporter.js +1796 -911
- data/app/models/govuk_publishing_components/component_docs.rb +1 -1
- data/app/views/govuk_publishing_components/components/_button.html.erb +3 -3
- data/app/views/govuk_publishing_components/components/_input.html.erb +3 -3
- data/app/views/govuk_publishing_components/components/_intervention.html.erb +2 -2
- data/app/views/govuk_publishing_components/components/_search.html.erb +2 -4
- data/app/views/govuk_publishing_components/components/_select.html.erb +15 -43
- data/app/views/govuk_publishing_components/components/_subscription_links.html.erb +7 -8
- data/app/views/govuk_publishing_components/components/docs/select.yml +1 -1
- data/config/initializers/assets.rb +1 -0
- data/lib/govuk_publishing_components/presenters/select_helper.rb +85 -0
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/lib/govuk_publishing_components.rb +1 -1
- metadata +21 -37
- data/app/assets/javascripts/govuk_publishing_components/lib/header-navigation.js +0 -100
- data/lib/govuk_publishing_components/presenters/select.rb +0 -43
- data/lib/tasks/govuk_publishing_components_tasks.rake +0 -49
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ebad3c8838bc6fe453b4dbf3274f3289885e17c4ab87456140663f68ab48fbb
|
4
|
+
data.tar.gz: 3a74ffb39a677727ac02521fb63549c7dd62f995c67b20555f0e07a9b89c2da3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f50da8d0de71594b12f61e96b030dd956e5cfe6e71cd12ffdd02365720d3a33b1c981633415f805d09c357fddf69e90bb853662256c2ef21bcdab4b1497a24e0
|
7
|
+
data.tar.gz: 8320ccc0808090c48328b117d18c6241341ebdb50c84e157868386992278d41d431c9a2a853f22330b07e6df6f0871cd73172cb1f8d7f5a71542c9a1b0ff820e
|
data/README.md
CHANGED
@@ -29,10 +29,10 @@ To run JavaScript tests (only):
|
|
29
29
|
|
30
30
|
```sh
|
31
31
|
# run JS tests in browser
|
32
|
-
|
32
|
+
yarn run jasmine:browser
|
33
33
|
|
34
34
|
# run JS tests on command line
|
35
|
-
|
35
|
+
yarn run jasmine:ci
|
36
36
|
```
|
37
37
|
|
38
38
|
### Further documentation
|
@@ -87,22 +87,23 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
87
87
|
var params = new FormData($form)
|
88
88
|
params = new URLSearchParams(params).toString()
|
89
89
|
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
xhr.onreadystatechange = function () {
|
94
|
-
if (xhr.readyState === 4 && xhr.status === 200) {
|
90
|
+
this.done = function () {
|
91
|
+
if (xhr.status === 200) {
|
95
92
|
this.trackEvent(this.getTrackEventParams($form))
|
96
93
|
this.showFormSuccess(xhr.message)
|
97
94
|
this.revealInitialPrompt()
|
98
95
|
this.setInitialAriaAttributes()
|
99
|
-
this.activeForm.hidden
|
96
|
+
this.activeForm.hidden = true
|
100
97
|
} else {
|
101
98
|
this.showError(xhr)
|
102
99
|
this.enableSubmitFormButton($form)
|
103
100
|
}
|
104
101
|
}.bind(this)
|
105
102
|
|
103
|
+
xhr.addEventListener('loadend', this.done)
|
104
|
+
xhr.open('POST', url, true)
|
105
|
+
xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded')
|
106
|
+
|
106
107
|
this.disableSubmitFormButton($form)
|
107
108
|
xhr.send(params)
|
108
109
|
}.bind(this))
|