From 5ef5b666c2caa7961523f5566d0f480d564dd7fb Mon Sep 17 00:00:00 2001 From: ache Date: Sun, 4 Feb 2018 04:49:32 +0100 Subject: Work on the style guideline --- public/js/qcm.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'public/js/qcm.js') diff --git a/public/js/qcm.js b/public/js/qcm.js index 3ce5724..6a09aa6 100644 --- a/public/js/qcm.js +++ b/public/js/qcm.js @@ -8,7 +8,7 @@ * */ -const check = (id => { +const check = id => { const fieldQCM = document.getElementById(id); Array.from(fieldQCM.getElementsByTagName('INPUT')).forEach(input => { @@ -16,11 +16,11 @@ const check = (id => { return; } - const label = document.querySelector('label[for=\'' + input.id + '\']'); + const label = document.querySelector(`label[for='${input.id}']`); if (input.checked) { - Array.from(label.getElementsByClassName('hiden_block_quote')).forEach((child => { + Array.from(label.getElementsByClassName('hiden_block_quote')).forEach(child => { child.classList.remove('hiden_block_quote'); - })); + }); } switch (input.className) { case '!': @@ -36,7 +36,7 @@ const check = (id => { // Empty } }); -}); +}; function shuffle(array) { let currentIndex = array.length; @@ -63,7 +63,7 @@ document.addEventListener('DOMContentLoaded', () => { listQCM.forEach(field => { let listInput = []; Array.from(field.getElementsByTagName('INPUT')).forEach(input => { - const label = document.querySelector('label[for=\'' + input.id + '\']'); + const label = document.querySelector(`label[for='${input.id}']`); listInput.push({input, label}); field.removeChild(input); field.removeChild(label); -- cgit v1.2.3-54-g00ecf