From c8a613389b98d91a7bce814cb463c1a53dd8d441 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 7 Nov 2022 12:49:49 +0200 Subject: [PATCH] remove/modify js return statements --- files/assets/js/comments+submission_listing.js | 6 ++---- files/assets/js/core.js | 5 +---- files/assets/js/emoji_modal.js | 4 ++-- files/assets/js/submission_listing.js | 6 +++--- 4 files changed, 8 insertions(+), 13 deletions(-) diff --git a/files/assets/js/comments+submission_listing.js b/files/assets/js/comments+submission_listing.js index ebf6e0209..5b0f0bcf7 100644 --- a/files/assets/js/comments+submission_listing.js +++ b/files/assets/js/comments+submission_listing.js @@ -17,7 +17,7 @@ popClickBadgeTemplateDOM.alt = "badge"; function popclick(e) { // We let through those methods if(e.ctrlKey || e.metaKey || e.shiftKey || e.altKey) - return true; + return; e.preventDefault(); if(e.currentTarget.dataset.popInfo === undefined) @@ -59,8 +59,6 @@ function popclick(e) { popover.getElementsByClassName('pop-coins')[0].innerHTML = author["coins"] popover.getElementsByClassName('pop-viewmore')[0].href = author["url"] }, 5); - - return false; } document.addEventListener("click", function(){ @@ -118,4 +116,4 @@ function bet_vote(oid) { post(`/vote/post/option/${oid}`); document.getElementById("user-coins-amount").innerText = parseInt(document.getElementById("user-coins-amount").innerText) - 200; -} \ No newline at end of file +} diff --git a/files/assets/js/core.js b/files/assets/js/core.js index 1763d77e7..6199ce66a 100644 --- a/files/assets/js/core.js +++ b/files/assets/js/core.js @@ -226,7 +226,7 @@ function formkey() { function expandDesktopImage(url) { const e = this.event if(e.ctrlKey || e.metaKey || e.shiftKey || e.altKey) - return true; + return; e.preventDefault(); if (!url) { @@ -388,7 +388,6 @@ function sendFormXHR(e, extraActionsOnSuccess) { let data = JSON.parse(xhr.response); showToast(true, getMessageFromJsonData(true, data)); if (extraActionsOnSuccess) extraActionsOnSuccess(xhr); - return true } else { document.getElementById('toast-post-error-text').innerText = "Error, please try again later." try { @@ -407,8 +406,6 @@ function sendFormXHR(e, extraActionsOnSuccess) { }; xhr.send(formData); - - return false } function sendFormXHRSwitch(e) { diff --git a/files/assets/js/emoji_modal.js b/files/assets/js/emoji_modal.js index 88a0e34a9..cf438fee1 100644 --- a/files/assets/js/emoji_modal.js +++ b/files/assets/js/emoji_modal.js @@ -521,7 +521,7 @@ function speed_carot_navigate(e) if (!selecting) return; let select_items = speed_carot_modal.querySelectorAll(".speed-modal-option"); - if (!select_items || !curr_word_is_emoji()) return false; + if (!select_items || !curr_word_is_emoji()) return; // Up or down arrow or enter if (e.keyCode == 38 || e.keyCode == 40 || e.keyCode == 13) { @@ -577,4 +577,4 @@ function loadEmojis(inputTargetIDName) document.getElementById('emojiModal').addEventListener('shown.bs.modal', function () { emojiSearchBarDOM.focus(); -}); \ No newline at end of file +}); diff --git a/files/assets/js/submission_listing.js b/files/assets/js/submission_listing.js index 3e7f3b3f4..ce33a9958 100644 --- a/files/assets/js/submission_listing.js +++ b/files/assets/js/submission_listing.js @@ -10,7 +10,7 @@ function expandText(id) { function togglevideo(pid) { const e = this.event if(e.ctrlKey || e.metaKey || e.shiftKey || e.altKey) - return true; + return; e.preventDefault(); let vid = document.getElementById(`video-${pid}`).classList vid.toggle('d-none') @@ -22,7 +22,7 @@ function togglevideo(pid) { function toggleyoutube(pid) { const e = this.event if(e.ctrlKey || e.metaKey || e.shiftKey || e.altKey) - return true; + return; e.preventDefault(); document.getElementById(`video-${pid}`).classList.toggle('d-none') -} \ No newline at end of file +}