From bdd338902b6b27b5ee45b75715024a03db80cba8 Mon Sep 17 00:00:00 2001 From: yflory Date: Fri, 10 Jan 2020 15:53:02 +0100 Subject: [PATCH] Hide radio buttons in share modal when no contacts --- www/common/common-ui-elements.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index 310c7172e..41b929034 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -1322,7 +1322,13 @@ define([ var contactButtons = friendsObject.buttons; contactButtons.unshift(makeCancelButton()); - + + var onShowContacts = function () { + if (!hasFriends) { + $rights.hide(); + } + }; + var frameContacts = UI.dialog.customModal(contactsContent, { buttons: contactButtons, onClose: config.onClose, @@ -1405,13 +1411,16 @@ define([ // Create modal var resetTab = function () { + $rights.show(); $rights.find('label.cp-radio').show(); }; var tabs = [{ title: Messages.share_contactCategory, icon: "fa fa-address-book", content: frameContacts, - active: hasFriends + active: hasFriends, + onShow: onShowContacts, + onHide: resetTab }, { title: Messages.share_linkCategory, icon: "fa fa-link",