Minor changes to toggling
parent
951c1fe1ab
commit
0cecead44b
|
@ -1165,16 +1165,19 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var snippetToggle = document.querySelector('#snippet-toggle');
|
var snippetToggle = document.querySelector('#snippet-toggle');
|
||||||
|
var snippets;
|
||||||
|
|
||||||
snippetToggle.addEventListener('click', function() {
|
snippetToggle.addEventListener('click', function() {
|
||||||
var snippets = document.querySelectorAll('.auto-gen-code-snippet');
|
if(snippets){
|
||||||
for(var i = 0; i < snippets.length; i++) {
|
for(var i = 0; i < snippets.length; i++) {
|
||||||
snippets[i].classList.toggle('auto-gen-code-visible');
|
snippets[i].classList.toggle('auto-gen-code-visible');
|
||||||
};
|
};
|
||||||
|
}
|
||||||
}, true);
|
}, true);
|
||||||
|
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
createCodeSamples();
|
createCodeSamples();
|
||||||
|
snippets = document.querySelectorAll('.auto-gen-code-snippet');
|
||||||
}
|
}
|
||||||
|
|
||||||
function createCodeSamples() {
|
function createCodeSamples() {
|
||||||
|
|
Loading…
Reference in New Issue