diff client.js @ 15:3eed9fe0bd7c

End spinners with either a green ✔ or a red ✘.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Sat, 22 Dec 2018 18:38:27 +0100
parents 962f64b156dd
children 07543f7f5e89
line wrap: on
line diff
--- a/client.js
+++ b/client.js
@@ -75,13 +75,13 @@ document.addEventListener('DOMContentLoa
             connect_button.classList.add('disconnect');
             jid_element.disabled = true;
             pass_element.disabled = true;
-            spinner_img.hidden = false;
+            displaySpinner(spinner_img);
         } else if (status == Strophe.Status.CONNFAIL) {
             console.log('Strophe failed to connect.');
             onDisconnected();
         } else if (status == Strophe.Status.DISCONNECTING) {
             console.log('Strophe is disconnecting.');
-            spinner_img.hidden = false;
+            displaySpinner(spinner_img);
         } else if (status == Strophe.Status.DISCONNECTED) {
             console.log('Strophe is disconnected.');
             onDisconnected();
@@ -96,7 +96,7 @@ document.addEventListener('DOMContentLoa
         jid_element.hidden = true;
         pass_element.hidden = true;
         connected_div.hidden = false;
-        spinner_img.hidden = true;
+        hideSpinner(spinner_img);
         initRoster(connection);
         initPEP(connection);
         initNickname(connection);
@@ -111,7 +111,7 @@ document.addEventListener('DOMContentLoa
         jid_element.disabled = false;
         pass_element.hidden = false;
         pass_element.disabled = false;
-        spinner_img.hidden = true;
+        hideSpinner(spinner_img);
         connected_div.hidden = true;
         let table = document.getElementById('roster-table');
         while (table.hasChildNodes()) {