From a8ca252e452b66787402b206736c0a839ae520cd Mon Sep 17 00:00:00 2001
From: Alexis POYEN <apoyen@grandlyon.com>
Date: Mon, 6 Jul 2020 09:46:59 +0200
Subject: [PATCH] Resolve "Zoom button"

---
 web/components/visualization/results-general.js | 3 ---
 web/components/visualization/results-section.js | 6 ++++++
 web/components/visualization/results-zone.js    | 6 +++---
 3 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/web/components/visualization/results-general.js b/web/components/visualization/results-general.js
index 6049359..84348c7 100644
--- a/web/components/visualization/results-general.js
+++ b/web/components/visualization/results-general.js
@@ -1,11 +1,8 @@
 // Imports
 import * as Auth from "/services/auth/auth.js";
-import * as results from "/services/election/calculate-election-generic.js";
 import * as PartyModel from "/services/model/party-model.js";
 import * as CandidateListModel from "/services/model/candidateList-model.js";
 import * as AreaModel from "/services/model/area-model.js";
-import * as Scroller from "/services/common/scroller.js";
-import * as ResultsZone from "/components/visualization/results-zone.js";
 
 export async function mount(where, parent) {
   const resultGeneralComponent = new ResultGeneralComponent(parent);
diff --git a/web/components/visualization/results-section.js b/web/components/visualization/results-section.js
index 45a5c4a..9327497 100644
--- a/web/components/visualization/results-section.js
+++ b/web/components/visualization/results-section.js
@@ -173,6 +173,12 @@ class ResultComponent {
       },
       false
     );
+
+    this.interval = setInterval(async () => {
+      this.calculateResults();
+      this.resultsZone.displayResults();
+      this.resultsGeneral.displayRoundResults();
+    }, 10000);
   }
 
   async calculateResults() {
diff --git a/web/components/visualization/results-zone.js b/web/components/visualization/results-zone.js
index 6092a16..254f0b5 100644
--- a/web/components/visualization/results-zone.js
+++ b/web/components/visualization/results-zone.js
@@ -34,7 +34,7 @@ class ResultZoneComponent {
             </p>
             <button id="zoom-map" class="button is-success">
               <span class="icon is-small">
-                <i class="fas fa-search"></i>
+                <i class="fa fa-expand"></i>
               </span>
             </button>
           </header>
@@ -57,7 +57,7 @@ class ResultZoneComponent {
             </label>
             <button id="zoom-news-flow" class="button is-success">
               <span class="icon is-small">
-                <i class="fas fa-search"></i>
+                <i class="fa fa-expand"></i>
               </span>
             </button>
           </header>
@@ -74,7 +74,7 @@ class ResultZoneComponent {
           </p>
           <button id="zoom-results" class="button is-success">
             <span class="icon is-small">
-              <i class="fas fa-search"></i>
+              <i class="fa fa-expand"></i>
             </span>
           </button>
         </header>
-- 
GitLab