Skip to content

Commit 66a7187

Browse files
committed
Updates 01-nav
“Link-less” category titles not working in html based on nav.adoc
1 parent 59dbd90 commit 66a7187

File tree

3 files changed

+43
-17
lines changed

3 files changed

+43
-17
lines changed

src/css/helios-gcx.css

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/* autoprefixer: off */
2+
3+
:root {
4+
--nav-background: #FFF;
5+
--navbar-height: 0;
6+
--announcement-height: 48px;
7+
}
8+
19
@font-face {
210
font-family: 'Material Icons';
311
font-style: normal;
@@ -18,12 +26,6 @@
1826
-webkit-font-smoothing: antialiased;
1927
}
2028

21-
:root {
22-
--nav-background: #FFF;
23-
--navbar-height: 0;
24-
--announcement-height: 48px;
25-
}
26-
2729
[data-template="landing"] .toc.sidebar {
2830
display: none;
2931
}
@@ -454,7 +456,7 @@ gcx-full .full-articles {
454456
.dark-mode .doc .listingblock .title,
455457
.dark-mode .doc .openblock .title,
456458
.dark-mode .doc .tableblock caption {
457-
color: var(--white);
459+
color: var(--body-background);
458460
}
459461

460462
.doc .sect1 {
@@ -975,9 +977,9 @@ label.switch_label:after {
975977
/* gcx-schema-sample-app-gallery */
976978

977979
.dark-mode gcx-schema-sample-app-gallery {
978-
--gcx-app-appgallery-h4-color: var(--white);
979-
--gcx-app-gallery-p-color: var(--color-interface-night-300);
980-
--gcx-sample-appgallery-card-background: var(--color-interface-night-900);
980+
--gcx-app-appgallery-h4-color: #fff;
981+
--gcx-app-gallery-p-color: #A6B1C2;
982+
--gcx-sample-appgallery-card-background: #20293A;
981983
--gcx-sample-appgallery-card-border: 2px solid #2E394E;
982984
}
983985

@@ -1129,8 +1131,8 @@ label.switch_label:after {
11291131
/* Dark mode: Bottom Sidebar*/
11301132

11311133
.dark-mode gcx-schema-bottom-sidebar {
1132-
--gcx-sidebar-h4-color: var(--white);
1133-
--gcx-sidebar-li-color: var(--white);
1134+
--gcx-sidebar-h4-color: #fff;
1135+
--gcx-sidebar-li-color: #fff;
11341136
}
11351137

11361138

src/js/01-nav.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
;(function () {
1+
;
2+
(function () {
23
'use strict'
34

45
var SECT_CLASS_RX = /^sect(\d)$/
@@ -135,9 +136,20 @@
135136
}
136137

137138
function trapEvent (e) {
139+
toggleByListElement(e)
138140
e.stopPropagation()
139141
}
140142

143+
function toggleByListElement (event) {
144+
if (!(event.target.matches('button') ||
145+
event.target.matches('path') ||
146+
event.target.matches('svg')) &&
147+
event.target.closest('li.nav-item.toggler')) {
148+
console.log(event.target)
149+
event.target.closest('li.nav-item.toggler').classList.toggle('is-active')
150+
}
151+
}
152+
141153
function scrollItemToMidpoint (panel, el) {
142154
var rect = panel.getBoundingClientRect()
143155
var effectiveHeight = rect.height

src/js/08-gcx-helios.js

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,22 @@ window.addEventListener('DOMContentLoaded', (event) => {
2222
}
2323

2424
document.addEventListener('click', function (event) {
25+
//No es un clic en el sidebar
26+
//if (!event.target.matches('li[data-depth="1"]') && !event.target.matches('.switch')) return;
27+
/* if (event.target.closest('li.nav-item.toggler')) {
28+
console.log(event.target)
29+
event.target.closest('li.nav-item.toggler').classList.toggle('is-active')
30+
}
31+
/*if ((event.target.matches('span.nav-text') ||
32+
event.target.matches('button.nav-item-toggle')) &&
33+
(event.target.offsetParent.matches('li[data-depth="1"]') ||
34+
event.target.offsetParent.matches('li[data-depth="0"]'))) {
35+
event.target.offsetParent.classList.toggle('is-active');
36+
}
37+
if (event.target.matches('li[data-depth="1"]') ||
38+
event.target.matches('li[data-depth="0"]')) {
39+
event.target.classList.toggle('is-active');
40+
}*/
2541
if (event.target.matches('.switch')) {
2642
var root = document.getElementsByTagName('html')[0]
2743
if (event.target.checked) {
@@ -34,10 +50,6 @@ window.addEventListener('DOMContentLoaded', (event) => {
3450
}
3551
}, false)
3652
})
37-
document.querySelector('.nav-item.toggler').addEventListener('click', function (event) {
38-
if (!event.target.matches('li[data-depth="1"]') && !event.target.matches('.switch')) return
39-
if (event.target.matches('li[data-depth="1"]')) { event.target.classList.toggle('is-active') }
40-
})
4153

4254
document.querySelector('#collapse').addEventListener('click', function (event) {
4355
const sidebar = document.querySelector('.sidebar')

0 commit comments

Comments
 (0)