govuk_publishing_components 25.5.0 → 25.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 75bbe4fa0f6a066c890631953c88c20877539ad38d4d3c5bd643d58fb67448e4
4
- data.tar.gz: 14d822a1adb2e3f6ad935f922e7175a4fd2f6cfd01f3c9e1a96df442924e8f4e
3
+ metadata.gz: b1b20d5bd22562106adb11d4dae477700ae7cf87c10e8113615ddccc43a57eee
4
+ data.tar.gz: 6c8cbab6a211c1d7192af9128ea910b9394702a7d369e1b48e29d74f541ce4a4
5
5
  SHA512:
6
- metadata.gz: ec49f4d9fbd7d37c802e1d7ac7e39559d4c7861483355225d9bde8d0df83b2656e77c07e3520ea52a09de678447eb3f1255dd3e3a96ddf33b07e46575058a7d5
7
- data.tar.gz: 42721bc8eedaf12aee5c82a673201e4fb6bb4ef1d103a0a683a398b0a77e53d323ab0ba49ab21ef1dce9960b4148e10395c580f52652cd9315ab0762e1393b57
6
+ metadata.gz: 298e4ac11183bbd0dc6dd364c9d831143c5b94e92b65e3afccad59269c1515e683834db2e3af528f7c2416c78a644cbd61aba803b66e65335195f8bc1e4dfd76
7
+ data.tar.gz: 71429d6099fcc7465c2fef3092fb9b586f385c399e1f90a71470a433d91d2f25314ed53e10b543a683cb3c94c7b8bcb44a272c5a3e479faab9a8f581e9405902
@@ -10,14 +10,20 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
10
10
  this.$module = $module[0]
11
11
  this.$module.handleClick = this.handleClick.bind(this)
12
12
  var trackLinksOnly = this.$module.hasAttribute('data-track-links-only')
13
+ var limitToElementClass = this.$module.getAttribute('data-limit-to-element-class')
13
14
 
14
15
  var that = this
15
16
  // add a listener to the whole element
16
17
  this.$module.addEventListener('click', function (e) {
18
+ var target = e.target
17
19
  if (!trackLinksOnly) {
18
- that.$module.handleClick(e.target)
19
- } else if (trackLinksOnly && e.target.tagName === 'A') {
20
- that.$module.handleClick(e.target)
20
+ that.$module.handleClick(target)
21
+ } else if (trackLinksOnly && target.tagName === 'A') {
22
+ if (!limitToElementClass) {
23
+ that.$module.handleClick(target)
24
+ } else if (limitToElementClass && target.closest('.' + limitToElementClass)) {
25
+ that.$module.handleClick(target)
26
+ }
21
27
  }
22
28
  })
23
29
  }
@@ -155,10 +155,6 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
155
155
  }
156
156
 
157
157
  this.$module.style.marginBottom = '0'
158
-
159
- window.removeEventListener('resize', this.resizeHandler, { passive: true })
160
-
161
- this.lastWindowSize = this.windowSize()
162
158
  }
163
159
 
164
160
  // Hide the navigation toggle button and show the navigation submenu:
@@ -166,10 +162,10 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
166
162
  this.$navigationToggle.setAttribute('hidden', 'hidden')
167
163
  this.$navigationMenu.removeAttribute('hidden')
168
164
 
169
- window.addEventListener('resize', this.resizeHandler, { passive: true })
170
-
171
- this.lastWindowSize = this.windowSize()
165
+ this.resizeHandler()
172
166
  }
167
+
168
+ this.lastWindowSize = this.windowSize()
173
169
  }
174
170
 
175
171
  SuperNavigationMegaMenu.prototype.buttonHandler = function (event) {
@@ -269,7 +269,11 @@ $search-icon-size: 20px;
269
269
  color: $govuk-link-colour;
270
270
 
271
271
  &:hover {
272
- color: govuk-colour("mid-grey");
272
+ color: $govuk-link-hover-colour;
273
+
274
+ @include govuk-media-query($from: "desktop") {
275
+ color: govuk-colour("mid-grey");
276
+ }
273
277
  }
274
278
 
275
279
  &:focus {
@@ -358,6 +362,10 @@ $search-icon-size: 20px;
358
362
  position: absolute;
359
363
  right: 45px;
360
364
 
365
+ &.gem-c-layout-super-navigation-header__open-button {
366
+ border-top-color: govuk-colour("black");
367
+ }
368
+
361
369
  @include govuk-media-query($from: 360px) {
362
370
  &:before {
363
371
  @include chevron("white");
@@ -388,8 +396,19 @@ $search-icon-size: 20px;
388
396
  position: absolute;
389
397
  right: (0 - govuk-spacing(3));
390
398
 
391
- &:hover {
392
- border-color: govuk-colour("black");
399
+ &:after {
400
+ background-color: $govuk-link-colour;
401
+ content: " ";
402
+ left: 0;
403
+ right: 0;
404
+ }
405
+
406
+ &:not(.gem-c-layout-super-navigation-header__open-button):focus {
407
+ &:hover,
408
+ &:after {
409
+ background-color: $govuk-focus-colour;
410
+ border-top-color: $govuk-focus-colour;
411
+ }
393
412
  }
394
413
 
395
414
  @include govuk-media-query($from: 360px) {
@@ -405,22 +424,6 @@ $search-icon-size: 20px;
405
424
  position: relative;
406
425
  float: right;
407
426
 
408
- &:not(.gem-c-layout-super-navigation-header__open-button):hover {
409
- background: none;
410
- color: govuk-colour("light-grey");
411
-
412
- &:after {
413
- content: " ";
414
- left: 0;
415
- right: 0;
416
- }
417
- }
418
-
419
- &:focus:hover:after,
420
- &:after {
421
- content: none;
422
- }
423
-
424
427
  &.gem-c-layout-super-navigation-header__open-button {
425
428
  border-top-color: govuk-colour("black");
426
429
 
@@ -486,7 +489,6 @@ $search-icon-size: 20px;
486
489
 
487
490
  &:focus {
488
491
  color: $govuk-focus-text-colour;
489
- // border-color: $govuk-focus-text-colour;
490
492
 
491
493
  &:after {
492
494
  background-color: $govuk-focus-text-colour;
@@ -501,10 +503,6 @@ $search-icon-size: 20px;
501
503
  &.gem-c-layout-super-navigation-header__open-button {
502
504
  border-top-color: govuk-colour("black");
503
505
 
504
- &:focus {
505
- border-top-color: $govuk-focus-colour;
506
- }
507
-
508
506
  &:before {
509
507
  transform: translateY(20%) rotate(225deg);
510
508
  }
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "25.5.0".freeze
2
+ VERSION = "25.6.0".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: 25.5.0
4
+ version: 25.6.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: 2021-08-20 00:00:00.000000000 Z
11
+ date: 2021-08-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govuk_app_config
@@ -198,14 +198,14 @@ dependencies:
198
198
  requirements:
199
199
  - - "~>"
200
200
  - !ruby/object:Gem::Version
201
- version: 3.8.0
201
+ version: 3.9.2
202
202
  type: :development
203
203
  prerelease: false
204
204
  version_requirements: !ruby/object:Gem::Requirement
205
205
  requirements:
206
206
  - - "~>"
207
207
  - !ruby/object:Gem::Version
208
- version: 3.8.0
208
+ version: 3.9.2
209
209
  - !ruby/object:Gem::Dependency
210
210
  name: jasmine_selenium_runner
211
211
  requirement: !ruby/object:Gem::Requirement