govuk_publishing_components 30.2.0 → 30.2.1

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: 4aee02160c93679a75c8418c7b1f0da2ed3908a6016f4437f06dfa0091b61096
4
- data.tar.gz: 629859a537593a4f5547cbfa45e866bde739b616ef0598f2428ea07bc0f0af26
3
+ metadata.gz: f402d935fbe75f4dde432aab1dd5f525388d478b99a960c57cedc2b73034ea0d
4
+ data.tar.gz: e6cf9788314e58be8a0f13158e7262a31dec5ff4adece4ee2daf117ebb5252f8
5
5
  SHA512:
6
- metadata.gz: 043a2bed5b586217a53aea43f53b9a43219b6f8947aaa90776d00a86ebb1f78c410131085401a2b0802a450426d85be2e22f986447e9e99c4d2afee76f95cbbb
7
- data.tar.gz: a52358d241fd9539a21fd7cb47c4d54fd2e402e0441758ec7348eb9b14c64444cfeaca9c54e03c34e8051c10bcac4c7c0f00999898f3586b5007f320ba9a5d86
6
+ metadata.gz: 76b3d647997d9248dc930d224037a2d31d54aebee66879668743e7a962b85a199aff66cfc95dcb200577de4292f8dcd769ea105497df3ea71206746d798e112e
7
+ data.tar.gz: c29eaaf88f004b23c2412b3db5667533e2ed76e69b9a59679875e1dd68c2522ab15f935f6ed66ee0df3bbfd8c619aa604359afebf4e2369ff481959d4f7f535f
@@ -5,16 +5,16 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
5
5
  (function (Modules) {
6
6
  'use strict'
7
7
 
8
- function GA4EventTracker (module) {
8
+ function Ga4EventTracker (module) {
9
9
  this.module = module
10
10
  this.trackingTrigger = 'data-ga4' // elements with this attribute get tracked
11
11
  }
12
12
 
13
- GA4EventTracker.prototype.init = function () {
13
+ Ga4EventTracker.prototype.init = function () {
14
14
  this.module.addEventListener('click', this.trackClick.bind(this), true) // useCapture must be true
15
15
  }
16
16
 
17
- GA4EventTracker.prototype.trackClick = function (event) {
17
+ Ga4EventTracker.prototype.trackClick = function (event) {
18
18
  if (window.dataLayer) {
19
19
  var target = this.findTrackingAttributes(event.target)
20
20
  if (target) {
@@ -76,7 +76,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
76
76
  }
77
77
  }
78
78
 
79
- GA4EventTracker.prototype.findTrackingAttributes = function (clicked) {
79
+ Ga4EventTracker.prototype.findTrackingAttributes = function (clicked) {
80
80
  if (clicked.hasAttribute('[' + this.trackingTrigger + ']')) {
81
81
  return clicked
82
82
  } else {
@@ -85,7 +85,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
85
85
  }
86
86
 
87
87
  // check if an attribute exists or contains the attribute
88
- GA4EventTracker.prototype.getClosestAttribute = function (clicked, attribute) {
88
+ Ga4EventTracker.prototype.getClosestAttribute = function (clicked, attribute) {
89
89
  var isAttributeOnElement = clicked.getAttribute(attribute)
90
90
  var containsAttribute = clicked.querySelector('[' + attribute + ']')
91
91
 
@@ -96,5 +96,5 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
96
96
  }
97
97
  }
98
98
 
99
- Modules.GA4EventTracker = GA4EventTracker
99
+ Modules.Ga4EventTracker = Ga4EventTracker
100
100
  })(window.GOVUK.Modules)
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "30.2.0".freeze
2
+ VERSION = "30.2.1".freeze
3
3
  end
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: 30.2.0
4
+ version: 30.2.1
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: 2022-08-18 00:00:00.000000000 Z
11
+ date: 2022-08-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govuk_app_config