diff options
| author | Samantaz Fox <coding@samantaz.fr> | 2022-04-27 18:32:40 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-04-27 18:32:40 +0200 |
| commit | 3bbd709bd6ef812d8c4458c192e166c53b76ab1d (patch) | |
| tree | 6d81622d1d091ae37e13b5de38a319f956f88d61 /assets/js/handlers.js | |
| parent | a0f566fef34ec3ee2a1badc7ac6e78099ad24892 (diff) | |
| parent | dbb1e3f5d8aae3d732bbf3ccf82baec0739d9445 (diff) | |
| download | invidious-3bbd709bd6ef812d8c4458c192e166c53b76ab1d.tar.gz invidious-3bbd709bd6ef812d8c4458c192e166c53b76ab1d.tar.bz2 invidious-3bbd709bd6ef812d8c4458c192e166c53b76ab1d.zip | |
Merge pull request #3045 from AHOHNMYC/js-lint
Js lint
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(); } |
