diff options
author | ache <ache@ache.one> | 2018-02-04 04:49:32 +0100 |
---|---|---|
committer | ache <ache@ache.one> | 2018-02-04 04:49:32 +0100 |
commit | 5ef5b666c2caa7961523f5566d0f480d564dd7fb (patch) | |
tree | e0ed1baf734f86ccc67613244147debbc09eda30 /public/js/script.js | |
parent | XO fix (diff) |
Work on the style guideline
Diffstat (limited to 'public/js/script.js')
-rw-r--r-- | public/js/script.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/public/js/script.js b/public/js/script.js index e90198c..1bcb250 100644 --- a/public/js/script.js +++ b/public/js/script.js @@ -12,7 +12,7 @@ document.addEventListener('DOMContentLoaded', () => { document.getElementById('tree').appendChild(addDirectory(data)); Array.from(document.getElementsByTagName('a')).forEach(a => { - a.onclick = (function (e) { + a.onclick = function (e) { e.preventDefault(); e.stopPropagation(); const setMd = new XMLHttpRequest(); @@ -23,19 +23,19 @@ document.addEventListener('DOMContentLoaded', () => { }; setMd.open('GET', a.href); setMd.send(); - }); + }; }); Array.from(document.getElementsByClassName('directory')).forEach(dir => { dir.querySelectorAll('ul').forEach(ul => { ul.style.display = 'none'; }); - dir.onclick = (e => { + dir.onclick = e => { e.stopPropagation(); dir.querySelectorAll('ul').forEach(ul => { ul.style.display = ul.style.display === 'none' ? 'block' : 'none'; }); - }); + }; }); } }; |