From be7decf3300e884aedccfba8401c3e4523f3dc5a Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Sat, 12 Sep 2020 14:33:15 -0700 Subject: [PATCH] Rearrange confirm_onclick because they have return statements now. Now that data-onclick begins with a return statement, this code was not running. --- frontends/etiquette_flask/static/js/common.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/frontends/etiquette_flask/static/js/common.js b/frontends/etiquette_flask/static/js/common.js index 5061dde..a8afd9a 100644 --- a/frontends/etiquette_flask/static/js/common.js +++ b/frontends/etiquette_flask/static/js/common.js @@ -332,12 +332,11 @@ function init_button_with_confirm() delete button.dataset.cancelClass; // If this is stupid, let me know. - let confirm_onclick = button.dataset.onclick + ` - ; + let confirm_onclick = ` let holder = event.target.parentElement.parentElement; holder.getElementsByClassName("confirm_holder_stage1")[0].classList.remove("hidden"); holder.getElementsByClassName("confirm_holder_stage2")[0].classList.add("hidden"); - ` + ` + button.dataset.onclick; button_confirm.onclick = Function(confirm_onclick); button.removeAttribute("onclick"); button.onclick = function(event)