From 6112cdc7e8b80f8cb23fc36c872b94e620c5d086 Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Mon, 6 Feb 2012 08:15:23 +0100 Subject: [PATCH] Hide container for emails/phones/adresses if there are none. --- apps/contacts/js/contacts.js | 4 ++++ apps/contacts/templates/part.contact.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/contacts/js/contacts.js b/apps/contacts/js/contacts.js index 45130dd048f..b66dd6949d5 100644 --- a/apps/contacts/js/contacts.js +++ b/apps/contacts/js/contacts.js @@ -253,6 +253,7 @@ Contacts={ return false; }, loadContact:function(jsondata){ + $('#contact_communication').hide(); this.data = jsondata; this.id = this.data.id; console.log('loaded: ' + this.data.FN[0]['value']); @@ -660,6 +661,7 @@ Contacts={ } if($('#addressdisplay dl').length > 1) { $('#addresses').show(); + $('#contact_communication').show(); } Contacts.UI.loadListHandlers(); return false; @@ -858,6 +860,7 @@ Contacts={ } if($('#emaillist li').length > 1) { $('#emails').show(); + $('#contact_communication').show(); } $('#emaillist li:last-child').find('input[type="text"]').focus(); @@ -919,6 +922,7 @@ Contacts={ } if($('#phonelist li').length > 1) { $('#phones').show(); + $('#contact_communication').show(); } return false; }, diff --git a/apps/contacts/templates/part.contact.php b/apps/contacts/templates/part.contact.php index 1c7b7b9067a..8a4faf720de 100644 --- a/apps/contacts/templates/part.contact.php +++ b/apps/contacts/templates/part.contact.php @@ -77,7 +77,7 @@ $card['ADR'] = (array_key_exists('ADR',$_['details'])) ? $_['details']['ADR'] : -
+
0?'':'style="display:none;"'); ?>>