From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1177960-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id DC9981382C5
	for <garchives@archives.gentoo.org>; Sun,  7 Jun 2020 21:55:32 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 20C74E08CD;
	Sun,  7 Jun 2020 21:55:32 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id E7DA1E08CD
	for <gentoo-commits@lists.gentoo.org>; Sun,  7 Jun 2020 21:55:31 +0000 (UTC)
Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 69B4734ED83
	for <gentoo-commits@lists.gentoo.org>; Sun,  7 Jun 2020 21:55:30 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 1EFB326
	for <gentoo-commits@lists.gentoo.org>; Sun,  7 Jun 2020 21:55:29 +0000 (UTC)
From: "Max Magorsch" <arzano@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Max Magorsch" <arzano@gentoo.org>
Message-ID: <1591566913.a0bd86ca404ac92f7751c6407445cb51419c44d0.arzano@gentoo>
Subject: [gentoo-commits] proj/gentoo-mirrorstats:master commit in: html/
X-VCS-Repository: proj/gentoo-mirrorstats
X-VCS-Files: html/stats.jinja2
X-VCS-Directories: html/
X-VCS-Committer: arzano
X-VCS-Committer-Name: Max Magorsch
X-VCS-Revision: a0bd86ca404ac92f7751c6407445cb51419c44d0
X-VCS-Branch: master
Date: Sun,  7 Jun 2020 21:55:29 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: ce0f2b37-8376-46c0-8a89-37aa335d7855
X-Archives-Hash: cb15b9420faff99773f531160f2a6ec3

commit:     a0bd86ca404ac92f7751c6407445cb51419c44d0
Author:     Max Magorsch <arzano <AT> gentoo <DOT> org>
AuthorDate: Sun Jun  7 21:55:13 2020 +0000
Commit:     Max Magorsch <arzano <AT> gentoo <DOT> org>
CommitDate: Sun Jun  7 21:55:13 2020 +0000
URL:        https://gitweb.gentoo.org/proj/gentoo-mirrorstats.git/commit/?id=a0bd86ca

Enlarge the page when using the filters

Signed-off-by: Max Magorsch <arzano <AT> gentoo.org>

 html/stats.jinja2 | 41 ++++++++++++++++++++++++++++++++++++-----
 1 file changed, 36 insertions(+), 5 deletions(-)

diff --git a/html/stats.jinja2 b/html/stats.jinja2
index 482a2cf..9c04d5a 100644
--- a/html/stats.jinja2
+++ b/html/stats.jinja2
@@ -78,7 +78,7 @@
   </header>
 
 
-  <div class="container">
+  <div id="map_container" class="container">
     <div class="row">
       <div class="col-md-12">
         <h1 class="first-header">Gentoo {% if type != "all" %}{{ type[0]|upper}}{{type[1:]}}{%endif%} Mirrors
@@ -98,6 +98,12 @@
         <div id="mirrorLocations" style="height: 500px; margin-bottom: 1em;"></div>
       </div>
 
+    </div>
+  </div>
+
+  <div id="table_container" class="container">
+      <div class="row">
+
       <div class="col-md-12 my-4">
         <table id="table_id" class="display table">
           <thead>
@@ -207,9 +213,13 @@
 
   <script>
 
-    $(function() {
+    var map;
+    function drawMap() {
+      if(map){
+          map.remove();
+      }
       L.Icon.Default.imagePath = 'https://www.gentoo.org/assets/img/maps/';
-      var map = L.map('mirrorLocations', { zoomAnimationThreshold: 9 } ).setView([30, 0], 2);
+      map = L.map('mirrorLocations', { zoomAnimationThreshold: 9 } ).setView([30, 0], 2);
       var markers = {};
 
       map.addLayer(new L.TileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { minZoom: 2, maxZoom: 8, attribution: 'Map data © <a href="https://openstreetmap.org">OpenStreetMap</a> contributors' }));
@@ -307,7 +317,9 @@
           markers[index] = marker;
         }
       });
-    });
+    }
+
+    drawMap();
   </script>
 
   <script>
@@ -352,7 +364,7 @@
         ],
         "initComplete": function( settings, json ) {
             setTimeout(function(){
-                $('#table_id_length').prepend("<button onclick='addFilters();' class='btn btn-outline-secondary filter-button btn-sm mr-4'>Toggle Filters</button>");
+                $('#table_id_length').prepend("<button onclick='addFilters();' class='btn btn-outline-secondary filter-button btn-sm mr-4'>Filters & Fullscreen</button>");
                 table.buttons().container().prependTo($('#table_id_length'));
                 $('#table_id_length').prepend("<span class='mr-1'> Show </span>");
                 document.getElementsByClassName("buttons-colvis")[0].classList = "custom-select custom-select-sm form-control form-control-sm mr-4";
@@ -363,6 +375,25 @@
 
     function addFilters(){
 
+        if(document.getElementById("table_container").classList == "container"){
+            document.getElementById("table_container").classList = "container-fluid"
+        }else{
+            document.getElementById("table_container").classList = "container";
+        }
+
+        if(document.getElementById("map_container").classList == "container"){
+            document.getElementById("map_container").classList = "container-fluid"
+        }else{
+            document.getElementById("map_container").classList = "container";
+        }
+
+        setTimeout(function() {
+            drawMap();
+            $("#table_id").width($("#table_container").width());
+            table.columns.adjust();
+        }, 200);
+
+
         if($("#filterRow").length) {
             $("#filterRow").remove();
         }else{