swedbank-pay-design-guide-jekyll-theme 2.1.3 → 2.1.4

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: bd0d14feada281feea751c1da6df4925d867153d132553742fa97bdc8e1d8d0c
4
- data.tar.gz: 1b10c80a6d932d4db5e2948c7f3cbc9d67ce1fffb0273f02264359ca8c58056e
3
+ metadata.gz: 392bd014e2ad81ab924970029ca0a05b7ca0723c413a3d39cffd7b6600231b88
4
+ data.tar.gz: 5b04611378f1cc05c57bbbdaaf3771df0391e4a8404476dd3ab6ef8dd5220048
5
5
  SHA512:
6
- metadata.gz: aa217d5c31a8bf836b27de51c51abe10b91dda890a1a68a6c156f99cd112557835ba9c710ae42d0165ef5542da75461987d563a73727774c969a232681c9c225
7
- data.tar.gz: 9d9e8a63c9b5f61ce8375192a93178ba26dae99628e4eacaee55f97e3fb919e43b4e519b3473f00b053cffe089d79c38372817c373b3e97a61a82a7e792d2bdb
6
+ metadata.gz: c83eedbfff55eb0a37eca47eb9e843f46f7b265e38896e50d65335b99e13d23078334246e1f97fa7a409b713fc551a96f2fbe615e6b9f1e7525c541f80bff41f
7
+ data.tar.gz: 847caad41617699d17b5fc93bf45e9289b2c416b37a462ef24824f974d4aa3a122a593c96abafd4490446e7003ec4bce1af42683abd5dac1c4b56cbf9cfd9b12
@@ -88,7 +88,7 @@
88
88
  {% endif %}
89
89
  </div>
90
90
  <div class="d-md-flex">
91
- <div id="dg-sidebar" class="sidebar dg-sidebar">
91
+ <div id="dg-sidebar" class="sidebar dg-sidebar has-secondary-nav">
92
92
  <nav class="sidebar-main-nav">
93
93
  <div class="sidebar-logo">
94
94
  <a href="/" class="sidebar-header">
data/lib/gem_version.rb CHANGED
@@ -4,7 +4,7 @@ module Gem
4
4
  # Gem Specification
5
5
  class Specification
6
6
  def self.gem_version
7
- '2.1.3'
7
+ '2.1.4'
8
8
  end
9
9
  end
10
10
  end
@@ -38,6 +38,10 @@ module SwedbankPay
38
38
  markup << item_markup(page, current_page, sub_items_markup, false)
39
39
  end
40
40
 
41
+ # We need to wait with the root class replacement until here because
42
+ # earlier in the process, the page HTML isn't loaded yet.
43
+ change_root_class(current_page)
44
+
41
45
  markup
42
46
  end
43
47
 
@@ -47,8 +51,6 @@ module SwedbankPay
47
51
  level = is_leaf ? -1 : page.level
48
52
  title_markup = title_markup(page, level, is_leaf)
49
53
  item_class = item_class(page, current_page, level, is_leaf)
50
- root_class = root_class(current_page)
51
- page.doc.xpath('//*[@id="dg-sidebar"]').first.set_attribute('class', root_class)
52
54
  "<li class=\"#{item_class}\">
53
55
  #{title_markup}
54
56
  #{if item_class === 'main-nav-li' || item_class === 'main-nav-li active'
@@ -62,9 +64,11 @@ module SwedbankPay
62
64
  </li>"
63
65
  end
64
66
 
65
- def root_class(current_page)
66
- is_home = current_page.path == '/'
67
- is_home ? 'sidebar dg-sidebar' : 'sidebar dg-sidebar has-secondary-nav'
67
+ def change_root_class(current_page)
68
+ return if current_page.path != '/'
69
+
70
+ # On 'home', set the 'class' to 'sidebar dg-sidebar' to effectively remove 'has-secondary-nav'.
71
+ current_page.doc.xpath('//*[@id="dg-sidebar"]').first.set_attribute('class', 'sidebar dg-sidebar')
68
72
  end
69
73
 
70
74
  def item_class(page, current_page, level, is_leaf)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: swedbank-pay-design-guide-jekyll-theme
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.3
4
+ version: 2.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Swedbank Pay