Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
LQDN Adminsys
generateur-slogans
Commits
41962a19
Verified
Commit
41962a19
authored
Sep 26, 2017
by
Thibaut Broggi
Browse files
Add default tab using javascript
Buttons "next" and "previous" now change the active tab using javascript
parent
aaadffc9
Changes
1
Hide whitespace changes
Inline
Side-by-side
canvas.js
View file @
41962a19
...
...
@@ -74,7 +74,6 @@ for (let i = 0; i < bgColorElems.length; ++i) {
}
document
.
getElementById
(
'
step2value
'
).
oninput
=
draw
;
document
.
getElementById
(
'
signature
'
).
oninput
=
draw
;
window
.
onload
=
draw
;
let
navElems
=
document
.
querySelectorAll
(
'
nav > a
'
);
for
(
let
i
=
0
;
i
<
navElems
.
length
;
++
i
)
{
...
...
@@ -85,3 +84,16 @@ for (let i = 0; i < navElems.length; ++i) {
e
.
target
.
classList
.
add
(
'
active-tab
'
);
}
}
let
navButtons
=
document
.
querySelectorAll
(
'
.prevButton, .nextButton
'
);
for
(
let
i
=
0
;
i
<
navButtons
.
length
;
++
i
)
{
navButtons
[
i
].
onclick
=
function
(
e
)
{
document
.
querySelector
(
'
nav > a[href="
'
+
e
.
target
.
attributes
.
href
.
value
+
'
"]
'
).
click
();
}
}
window
.
onload
=
function
()
{
draw
();
let
hash
=
window
.
location
.
hash
||
'
#step1
'
;
document
.
querySelector
(
'
nav > a[href="
'
+
hash
+
'
"]
'
).
click
();
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment