From: CMDR furrycat Date: Mon, 18 Jan 2016 13:54:07 +0000 (-0500) Subject: Constrain system and station list size. X-Git-Url: http://git.furryclan.net/?a=commitdiff_plain;h=324705ece1c6e7f8f95a4648ea0a1c4d847dc959;p=furrycat%2Frace-o-matic.git Constrain system and station list size. --- diff --git a/lib/station.php b/lib/station.php index caf5b68..ddf96ed 100644 --- a/lib/station.php +++ b/lib/station.php @@ -32,12 +32,14 @@ $q = new StationQuery; $q->joinWith('Station.System'); $stations = $q->orderBy('System.Name')->orderByName()->find(); + echo "
"; foreach ($stations as $station) { $station_name = $station->getName(); $system_name = $station->getSystem()->getName(); $type = $station->getType(); echo "

$station_name $type in $system_name

\n"; } + echo "
"; echo "
\n"; $sq = new SystemQuery; diff --git a/lib/system.php b/lib/system.php index 57027f1..a774046 100644 --- a/lib/system.php +++ b/lib/system.php @@ -26,10 +26,12 @@ $q = new SystemQuery; $systems = $q->orderByName()->find(); if (! count($systems)) echo "

No systems

\n"; + echo "
\n"; foreach ($systems as $system) { $system_name = $system->getName(); echo "

$system_name

\n"; } + echo "
\n"; echo "
\n"; form(); diff --git a/station.js b/station.js new file mode 100644 index 0000000..f2c303d --- /dev/null +++ b/station.js @@ -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(); diff --git a/style.css b/style.css index 28e9a62..72d7fac 100644 --- 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 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();