aboutsummaryrefslogtreecommitdiffstats
path: root/theme
diff options
context:
space:
mode:
authorGravatar Gehad elrobey <gehadelrobey@gmail.com>2014-08-15 09:50:05 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-08-17 12:03:14 -0600
commit27e400f5e4c59535fddd383d816fcc8f653f665a (patch)
treee2a89aedee249d65205e8c9fe43b1d0445c4d90d /theme
parentd2891ecbd0c9cf34fb397586147b1c08cff216dc (diff)
downloadsubsurface-27e400f5e4c59535fddd383d816fcc8f653f665a.tar.gz
HTML: don't show cylinders or weights table if they don't exist
Don't show the table header of cylinders or weights if they are not available. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'theme')
-rw-r--r--theme/list_lib.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/theme/list_lib.js b/theme/list_lib.js
index 6e5dc8730..9a79b2321 100644
--- a/theme/list_lib.js
+++ b/theme/list_lib.js
@@ -816,6 +816,9 @@ function get_weight_HTML(weight)
*/
function get_weights_HTML(dive)
{
+ if (!dive.Weights.length)
+ return "";
+
var result = "";
result += '<table><tr><td class="words">' + translate.Weight + '</td><td class="words">' + translate.Type + '</td></tr>';
for (var i in dive.Weights) {
@@ -850,6 +853,9 @@ function get_cylinder_HTML(cylinder)
*/
function get_cylinders_HTML(dive)
{
+ if (!dive.Cylinders.length)
+ return "";
+
var result = "";
result += '<h2 class="det_hed">' + translate.Dive_equipments + '</h2><table><tr><td class="words">' + translate.Type + '</td><td class="words">' + translate.Size + '</td><td class="words">' + translate.Work_Pressure + '</td><td class="words">' + translate.Start_Pressure + '</td><td class="words">' + translate.End_Pressure + '</td><td class="words">O2</td></tr>';
for (var i in dive.Cylinders) {