diff --git a/files/assets/js/award_modal.js b/files/assets/js/award_modal.js index a45f5b27f2..9725f54e32 100644 --- a/files/assets/js/award_modal.js +++ b/files/assets/js/award_modal.js @@ -91,15 +91,15 @@ function vote(type, id, dir) { xhr[0].send(xhr[1]); } -function pick(kind, canbuy1, canbuy2) { +function pick(kind, price, coins, marseybux) { const buy1 = document.getElementById('buy1') - if (canbuy1 && kind != "grass") + if (coins >= price && kind != "grass") buy1.disabled=false; else buy1.disabled=true; const buy2 = document.getElementById('buy2') - if (canbuy2 && kind != "benefactor") + if (marseybux >= price && kind != "benefactor") buy2.disabled=false; else buy2.disabled=true; diff --git a/files/assets/js/bottom.js b/files/assets/js/bottom.js index 3176429bd2..d3709c6cb6 100644 --- a/files/assets/js/bottom.js +++ b/files/assets/js/bottom.js @@ -28,8 +28,6 @@ document.addEventListener("click", function(e){ insertGIF(e.target.src); else if (element.classList.contains('gif-cat-overlay')) searchGifs(e.target.firstElementChild.innerHTML); - else if (element.dataset.onclick) - execute(element, 'onclick'); else if (element.dataset.href) location.href = element.dataset.href; @@ -38,6 +36,11 @@ document.addEventListener("click", function(e){ } }); +const onclick = document.querySelectorAll('[data-onclick]'); +for (const element of onclick) { + element.onclick = ()=>{execute(element, 'onclick')}; +} + const oninput = document.querySelectorAll('[data-oninput]'); for (const element of oninput) { element.oninput = ()=>{execute(element, 'oninput')}; diff --git a/files/templates/modals/award.html b/files/templates/modals/award.html index 5029fd6c15..f7f7b1af59 100644 --- a/files/templates/modals/award.html +++ b/files/templates/modals/award.html @@ -12,7 +12,7 @@