From 27e400f5e4c59535fddd383d816fcc8f653f665a Mon Sep 17 00:00:00 2001 From: Gehad elrobey Date: Fri, 15 Aug 2014 09:50:05 +0300 Subject: [PATCH] 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 Signed-off-by: Miika Turkia Signed-off-by: Dirk Hohndel --- theme/list_lib.js | 6 ++++++ 1 file changed, 6 insertions(+) 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 += ''; 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 += '

' + translate.Dive_equipments + '

' + translate.Weight + '' + translate.Type + '
'; for (var i in dive.Cylinders) {
' + translate.Type + '' + translate.Size + '' + translate.Work_Pressure + '' + translate.Start_Pressure + '' + translate.End_Pressure + 'O2