govuk_tech_docs 2.0.9 → 2.0.10

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of govuk_tech_docs might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f7709b58fc3cee254691d4c894c58ee3cb273a9f4ab1261ee14601017af55e90
4
- data.tar.gz: 63caab96ff45ca3724abb714d309bcc9ef07dc4f9151c1fec6d850095eaf4ab3
3
+ metadata.gz: a5cb57539ae552c6d1e24f8975a0f86171c2f88b0ec8584fa409067b8dadfe46
4
+ data.tar.gz: ded8edc17245592306e4d9330c0feb974daa471d873d773e9f19f2b1c07b6bf3
5
5
  SHA512:
6
- metadata.gz: 645fb6043c122b389a0c89f37f7df17b41a0e8d019e576f141a93b424622aab11eecfc123cad8d83593379bfbf1943ad104aa4bdc652f76954679f2366678087
7
- data.tar.gz: 6c8f05e3b7f36e94e08d696ea50444e8459835f078714f094e2d70f0f1c1e8672e67dfe73563e2ad44f87fd1923f987211c3cecbd456f092dd0da3c6269a9fed
6
+ metadata.gz: b9250bfe4da754f495df7f2b4f3c1c2066f85db1e9a8d15cb7b9c646a031fce10541fe43ef68964f09d03c0a636fd79c4024224bc109d083fc2bec894ee1ab62
7
+ data.tar.gz: 01ccc6902089cc61a1cc8a820e2ac22b526a96011a2f0c77d6b8a381d4af44019741da0c9e014715c2637a0fee1d2d39ebf32fdbddc1e37ab39af7d537029b60
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 2.0.10
6
+
7
+ - [Pull request #160: Make sure IDs on collapsible navigation are unique](https://github.com/alphagov/tech-docs-gem/pull/160)
8
+
5
9
  ## 2.0.9
6
10
 
7
11
  ### Fixes
@@ -0,0 +1,5 @@
1
+ ---
2
+ title: Another nested nested page
3
+ ---
4
+
5
+ # Another nested nested page
@@ -28,11 +28,16 @@
28
28
  continue
29
29
  }
30
30
  $topLevelItem.addClass('collapsible')
31
- $listing.addClass('collapsible__body')
32
- .attr('id', id)
33
- .attr('aria-expanded', 'false')
31
+ var arrayOfIds = []
32
+ $listing.each(function (i) {
33
+ var uniqueId = id + '-' + i
34
+ arrayOfIds.push(uniqueId)
35
+ $(this).addClass('collapsible__body')
36
+ .attr('id', uniqueId)
37
+ .attr('aria-expanded', 'false')
38
+ })
34
39
  $heading.addClass('collapsible__heading')
35
- .after('<button class="collapsible__toggle" aria-controls="' + id + '"><span class="collapsible__toggle-label">Expand ' + $heading.text() + '</span><span class="collapsible__toggle-icon" aria-hidden="true"></button>')
40
+ .after('<button class="collapsible__toggle" aria-controls="' + arrayOfIds.join(' ') + '"><span class="collapsible__toggle-label">Expand ' + $heading.text() + '</span><span class="collapsible__toggle-icon" aria-hidden="true"></button>')
36
41
  $topLevelItem.on('click', '.collapsible__toggle', function (e) {
37
42
  e.preventDefault()
38
43
  var $parent = $(this).parent()
@@ -1,3 +1,3 @@
1
1
  module GovukTechDocs
2
- VERSION = "2.0.9".freeze
2
+ VERSION = "2.0.10".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_tech_docs
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.9
4
+ version: 2.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Government Digital Service
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-11-14 00:00:00.000000000 Z
11
+ date: 2019-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -358,6 +358,7 @@ files:
358
358
  - example/source/hidden-page.html.md
359
359
  - example/source/index.html.md.erb
360
360
  - example/source/javascripts/application.js
361
+ - example/source/nested-page/another-nested-nested-page/index.html.md
361
362
  - example/source/nested-page/another-nested-page/index.html.md
362
363
  - example/source/nested-page/index.html.md
363
364
  - example/source/not-expired-page.html.md