diff options
Diffstat (limited to 'assets/js/handlers.js')
| -rw-r--r-- | assets/js/handlers.js | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/assets/js/handlers.js b/assets/js/handlers.js index 02175957..3224e668 100644 --- a/assets/js/handlers.js +++ b/assets/js/handlers.js @@ -76,7 +76,7 @@ }); n2a(document.querySelectorAll('[data-onrange="update_volume_value"]')).forEach(function (e) { - var cb = function () { update_volume_value(e); } + var cb = function () { update_volume_value(e); }; e.oninput = cb; e.onchange = cb; }); @@ -102,13 +102,13 @@ xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); xhr.onreadystatechange = function () { - if (xhr.readyState == 4) { - if (xhr.status != 200) { + if (xhr.readyState === 4) { + if (xhr.status !== 200) { count.innerText = parseInt(count.innerText) + 1; row.style.display = ''; } } - } + }; var csrf_token = target.parentNode.querySelector('input[name="csrf_token"]').value; xhr.send('csrf_token=' + csrf_token); @@ -131,20 +131,20 @@ xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); xhr.onreadystatechange = function () { - if (xhr.readyState == 4) { - if (xhr.status != 200) { + if (xhr.readyState === 4) { + if (xhr.status !== 200) { count.innerText = parseInt(count.innerText) + 1; row.style.display = ''; } } - } + }; var csrf_token = target.parentNode.querySelector('input[name="csrf_token"]').value; xhr.send('csrf_token=' + csrf_token); } // Handle keypresses - window.addEventListener('keydown', (event) => { + window.addEventListener('keydown', function (event) { // Ignore modifier keys if (event.ctrlKey || event.metaKey) return; @@ -152,14 +152,14 @@ let focused_tag = document.activeElement.tagName.toLowerCase(); const allowed = /^(button|checkbox|file|radio|submit)$/; - if (focused_tag === "textarea") return; - if (focused_tag === "input") { + if (focused_tag === 'textarea') return; + if (focused_tag === 'input') { let focused_type = document.activeElement.type.toLowerCase(); if (!focused_type.match(allowed)) return; } // Focus search bar on '/' - if (event.key == "/") { + if (event.key === '/') { document.getElementById('searchbox').focus(); event.preventDefault(); } |
