Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 32204f8

Browse files
committed
Fix navbar scrolling on close
1 parent b620993 commit 32204f8

File tree

3 files changed

+21
-15
lines changed

3 files changed

+21
-15
lines changed

‎public/bundle.js‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -693,9 +693,7 @@ function loadPage() {
693693
} else {
694694
// FAILED
695695
let userCommand = textarea.value;
696-
// console.log(userCommand.match(/(git)\s(\w+)/g)[0]);
697696
let splitCommand = userCommand.match(/(git)\s(\w+)/g) !== null ? userCommand.match(/(git)\s(\w+)/g)[0] : undefined;
698-
console.log(splitCommand);
699697
let comando = lecciones[leccionActual].comando;
700698
if (splitCommand != undefined && comando.match(/(git)\s(\w+)/g)[0] == splitCommand) {
701699
let parrafo = createElementNode("p", "Used " + splitCommand);
@@ -835,6 +833,7 @@ function loadPage() {
835833
li.addEventListener('click', (e) => {
836834
if (navbar.classList.contains('expanded')) {
837835
e.stopPropagation();
836+
navbar.scrollTop = 0;
838837
consoleArea.appendChild(clearTerminal());
839838
addTextareaListener();
840839
leccionActual = i;
@@ -1001,15 +1000,14 @@ function loadPage() {
10011000

10021001
// Mostrar y ocultar Menu principal
10031002
navbar.addEventListener('click', (e) => {
1004-
let ul = document.querySelector('nav ul');
10051003
if (navbar.classList.contains('expanded') === false) {
10061004
navbar.classList.toggle('expanded');
10071005
}
10081006
});
10091007

10101008
document.querySelector('main').addEventListener('click', () => {
1011-
let ul = document.querySelector('nav ul');
10121009
navbar.classList.remove('expanded');
1010+
navbar.scrollTop = 0;
10131011
});
10141012

10151013

‎public/css/style.css‎

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ main:after {
6262
width: 100%;
6363
opacity: .9;
6464
z-index: 9;
65+
-webkit-transition: all .2s linear;
6566
transition: all .2s linear;
6667
position: absolute;
6768
}
@@ -331,10 +332,10 @@ a.logo-link {
331332
#instrucciones {
332333
background-color: #FBFBFB;
333334
color: #434343;
334-
-webkit-box-flex: 3;
335-
-ms-flex: 3;
336-
flex: 3;
337-
padding: 30px 30px 10px 30px;
335+
-webkit-box-flex: 2;
336+
-ms-flex: 2;
337+
flex: 2;
338+
padding: 30px 20px 10px 20px;
338339
min-height: 300px;
339340
display: -webkit-box;
340341
display: -ms-flexbox;
@@ -403,14 +404,23 @@ a.logo-link {
403404

404405
div#terminal {
405406
padding: 0;
406-
flex: 2;
407+
-webkit-box-flex: 2;
408+
-ms-flex: 2;
409+
flex: 2;
407410
height: 100%;
411+
display: -webkit-box;
412+
display: -ms-flexbox;
408413
display: flex;
409-
flex-direction: column;
414+
-webkit-box-orient: vertical;
415+
-webkit-box-direction: normal;
416+
-ms-flex-direction: column;
417+
flex-direction: column;
410418
}
411419

412420
.console-area {
413-
flex: 1;
421+
-webkit-box-flex: 1;
422+
-ms-flex: 1;
423+
flex: 1;
414424
display: -webkit-box;
415425
display: -ms-flexbox;
416426
display: flex;

‎src/js/main.js‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,7 @@ function loadPage() {
133133
} else {
134134
// FAILED
135135
let userCommand = textarea.value;
136-
// console.log(userCommand.match(/(git)\s(\w+)/g)[0]);
137136
let splitCommand = userCommand.match(/(git)\s(\w+)/g) !== null ? userCommand.match(/(git)\s(\w+)/g)[0] : undefined;
138-
console.log(splitCommand);
139137
let comando = lecciones[leccionActual].comando;
140138
if (splitCommand != undefined && comando.match(/(git)\s(\w+)/g)[0] == splitCommand) {
141139
let parrafo = createElementNode("p", "Used " + splitCommand);
@@ -275,6 +273,7 @@ function loadPage() {
275273
li.addEventListener('click', (e) => {
276274
if (navbar.classList.contains('expanded')) {
277275
e.stopPropagation();
276+
navbar.scrollTop = 0;
278277
consoleArea.appendChild(clearTerminal());
279278
addTextareaListener();
280279
leccionActual = i;
@@ -441,15 +440,14 @@ function loadPage() {
441440

442441
// Mostrar y ocultar Menu principal
443442
navbar.addEventListener('click', (e) => {
444-
let ul = document.querySelector('nav ul');
445443
if (navbar.classList.contains('expanded') === false) {
446444
navbar.classList.toggle('expanded');
447445
}
448446
});
449447

450448
document.querySelector('main').addEventListener('click', () => {
451-
let ul = document.querySelector('nav ul');
452449
navbar.classList.remove('expanded');
450+
navbar.scrollTop = 0;
453451
});
454452

455453

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /