From 311d1bbf8b1ce6c4569ee4c1970a43299db256a2 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Sat, 15 Jun 2019 14:24:50 -0700 Subject: [PATCH] Rearrange condition to be positive-first. --- frontends/etiquette_flask/static/js/spinner.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontends/etiquette_flask/static/js/spinner.js b/frontends/etiquette_flask/static/js/spinner.js index e364c6e..871f0b5 100644 --- a/frontends/etiquette_flask/static/js/spinner.js +++ b/frontends/etiquette_flask/static/js/spinner.js @@ -8,13 +8,13 @@ function Spinner(element) clearTimeout(this.delayed_showing_timeout); this.delayed_showing_timeout = null; - if (! delay) + if (delay) { - this.element.classList.remove("hidden"); + this.delayed_showing_timeout = setTimeout(this.show, delay); } else { - this.delayed_showing_timeout = setTimeout(this.show, delay); + this.element.classList.remove("hidden"); } }