changeset 296:625cac7c230d gmap2

Use CSS class instead of direct style / background color manipulation.
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 19 Nov 2016 02:27:01 +0200
parents eb98c0758955
children 537620c8f53b
files css/common.css markers.js
diffstat 2 files changed, 13 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/css/common.css	Sat Nov 19 02:21:25 2016 +0200
+++ b/css/common.css	Sat Nov 19 02:27:01 2016 +0200
@@ -10,15 +10,22 @@
 .c_all div { background: #0af; }
 
 #controls span {
-	text-shadow: 1px 1px 1px #000;
 	border: 1px solid black;
-	margin: 2px;
+	margin: 0.15em;
 	display: inline-table;
+	border-radius: 0.2em;
 }
 
 #controls span a {
 	text-decoration: none;
 	color: black;
-	padding: 6px;
+	padding: 1em;
 }
 
+#controls div {
+	padding-bottom: 1em;
+}
+
+#controls span.visible { background: white; }
+#controls span.hidden { background: red; }
+
--- a/markers.js	Sat Nov 19 02:21:25 2016 +0200
+++ b/markers.js	Sat Nov 19 02:27:01 2016 +0200
@@ -301,7 +301,9 @@
 function pmapSetFilterVisState(c, show)
 {
   markerVisStates[c] = show;
-  document.getElementById("sp" + c).style.background = show ? "white" : "red";
+  var elem = document.getElementById("sp" + c);
+  elem.classList.add(show ? "visible" : "hidden");
+  elem.classList.remove(!show ? "visible" : "hidden");
 }