Constrain system and station list size.
authorCMDR furrycat <elite@furrycat.net>
Mon, 18 Jan 2016 13:54:07 +0000 (08:54 -0500)
committerCMDR furrycat <elite@furrycat.net>
Mon, 18 Jan 2016 13:54:07 +0000 (08:54 -0500)
lib/station.php
lib/system.php
station.js [new file with mode: 0644]
style.css
system.js [new file with mode: 0644]

index caf5b68..ddf96ed 100644 (file)
     $q = new StationQuery;
     $q->joinWith('Station.System');
     $stations = $q->orderBy('System.Name')->orderByName()->find();
+    echo "<div id=\"stations\">";
     foreach ($stations as $station) {
       $station_name = $station->getName();
       $system_name = $station->getSystem()->getName();
       $type = $station->getType();
       echo "<p><strong>$station_name</strong> $type in <em>$system_name</em></p>\n";
     }
+    echo "</div>";
 
     echo "<hr>\n";
     $sq = new SystemQuery;
index 57027f1..a774046 100644 (file)
     $q = new SystemQuery;
     $systems = $q->orderByName()->find();
     if (! count($systems)) echo "<p>No systems</p>\n";
+    echo "<div id=\"systems\">\n";
     foreach ($systems as $system) {
       $system_name = $system->getName();
       echo "<p><strong>$system_name</strong></p>\n";
     }
+    echo "</div>\n";
 
     echo "<hr>\n";
     form();
diff --git a/station.js b/station.js
new file mode 100644 (file)
index 0000000..f2c303d
--- /dev/null
@@ -0,0 +1,8 @@
+/* Document onload. */
+function loaded() {
+  var div = document.getElementById('stations');
+  console.log([div.offsetHeight, window.innerHeight].join(' vs '));
+  if (div && div.offsetHeight > window.innerHeight * 0.9) div.style.height = '80%';
+}
+
+document.onload = loaded();
index 28e9a62..72d7fac 100644 (file)
--- a/style.css
+++ b/style.css
@@ -7,3 +7,5 @@ th:nth-child(n+2),td:nth-child(n+2) { text-align: center; }
 table.entries { background-color: black; }
 table.entries th, table.entries td { text-align: center; }
 .classification .bbcode { display: none; background-color: rgba(0, 0, 0, 0.1); }
+#systems { overflow-x: auto; }
+#stations { overflow-x: auto; }
diff --git a/system.js b/system.js
new file mode 100644 (file)
index 0000000..4207b78
--- /dev/null
+++ b/system.js
@@ -0,0 +1,8 @@
+/* Document onload. */
+function loaded() {
+  var div = document.getElementById('systems');
+  console.log([div.offsetHeight, window.innerHeight].join(' vs '));
+  if (div && div.offsetHeight > window.innerHeight * 0.9) div.style.height = '80%';
+}
+
+document.onload = loaded();