diff --git a/assets/js/utils/calendar_event_popover.js b/assets/js/utils/calendar_event_popover.js index 625b9749..1ed12e6e 100644 --- a/assets/js/utils/calendar_event_popover.js +++ b/assets/js/utils/calendar_event_popover.js @@ -22,7 +22,7 @@ App.Utils.CalendarEventPopover = (function () { * * @param {Object} user Should have the address, city, etc properties. * - * @return {string} The rendered HTML. + * @return {String} The rendered HTML. */ function renderMapIcon(user) { const data = []; @@ -44,7 +44,7 @@ App.Utils.CalendarEventPopover = (function () { } if (!data.length) { - return ''; + return null; } return $('
', { @@ -69,9 +69,13 @@ App.Utils.CalendarEventPopover = (function () { * * @param {String} email * - * @return {string} The rendered HTML. + * @return {String} The rendered HTML. */ function renderMailIcon(email) { + if (!email) { + return null; + } + return $('', { 'html': [ $('', { @@ -94,9 +98,13 @@ App.Utils.CalendarEventPopover = (function () { * * @param {String} phone * - * @return {string} The rendered HTML. + * @return {String} The rendered HTML. */ function renderPhoneIcon(phone) { + if (!phone) { + return null; + } + return $('', { 'html': [ $('', {