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 +4 -4
- data/_layouts/default.html +1 -1
- data/lib/gem_version.rb +1 -1
- data/lib/sidebar_html_builder.rb +9 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 392bd014e2ad81ab924970029ca0a05b7ca0723c413a3d39cffd7b6600231b88
|
4
|
+
data.tar.gz: 5b04611378f1cc05c57bbbdaaf3771df0391e4a8404476dd3ab6ef8dd5220048
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c83eedbfff55eb0a37eca47eb9e843f46f7b265e38896e50d65335b99e13d23078334246e1f97fa7a409b713fc551a96f2fbe615e6b9f1e7525c541f80bff41f
|
7
|
+
data.tar.gz: 847caad41617699d17b5fc93bf45e9289b2c416b37a462ef24824f974d4aa3a122a593c96abafd4490446e7003ec4bce1af42683abd5dac1c4b56cbf9cfd9b12
|
data/_layouts/default.html
CHANGED
@@ -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
data/lib/sidebar_html_builder.rb
CHANGED
@@ -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
|
66
|
-
|
67
|
-
|
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)
|