govuk_publishing_components 38.3.2 → 38.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e7ea0b6a93379ec1e7cb8e5b7194c5cc16e237129cdbe224b9a099d79f4ca7ff
|
4
|
+
data.tar.gz: 567e2f625bd4b773a48f56c13c15d383f4fcdba5c44c9369ae327b8cf5772419
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b0bd17834a7658027b98c43cf2b2514f4bdb3ee06974e21bd27932a81e4f4ce4a7785468623d92511026e8773ae9af78dccca88c3c1ba0ba88ee89ff06b81aa
|
7
|
+
data.tar.gz: 1544edbfac9e4d2f5723f220aadd5619b86ff3386dae982d6b53ee9d8e20ba264a52f54ee44a6194b9ae912d8f0684d2a20bd3f0ff33d8d0775ca09cae3b8d86
|
@@ -36,15 +36,20 @@
|
|
36
36
|
var moduleName = camelCaseAndCapitalise(moduleNames[j])
|
37
37
|
var started = element.getAttribute('data-' + moduleNames[j] + '-module-started')
|
38
38
|
if (typeof GOVUK.Modules[moduleName] === 'function' && !started) {
|
39
|
-
|
40
|
-
|
41
|
-
|
39
|
+
try {
|
40
|
+
if (GOVUK.Modules[moduleName].prototype.init) {
|
41
|
+
// Vanilla JavaScript GOV.UK Modules and GOV.UK Frontend V4 Modules
|
42
42
|
new GOVUK.Modules[moduleName](element).init()
|
43
|
-
|
44
|
-
|
45
|
-
//
|
46
|
-
|
43
|
+
} else {
|
44
|
+
// GOV.UK Frontend V5 Modules - removed component init() methods and initialise in constructor
|
45
|
+
// https://github.com/alphagov/govuk-design-system-architecture/blob/main/decision-records/010-remove-init-method.md
|
46
|
+
/* eslint-disable no-new */
|
47
|
+
new GOVUK.Modules[moduleName](element)
|
47
48
|
}
|
49
|
+
element.setAttribute('data-' + moduleNames[j] + '-module-started', true)
|
50
|
+
} catch (e) {
|
51
|
+
// if there's a problem with the module, catch the error to allow other modules to start
|
52
|
+
console.error('Error starting ' + moduleName + ' component JS: ', e, window.location)
|
48
53
|
}
|
49
54
|
}
|
50
55
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: govuk_publishing_components
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 38.
|
4
|
+
version: 38.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GOV.UK Dev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-05-
|
11
|
+
date: 2024-05-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: govuk_app_config
|