ignore click action for an empty value

This commit is contained in:
ralf 2022-03-18 09:53:09 +02:00
parent 96039e0729
commit 5650e8c616
2 changed files with 3 additions and 1 deletions

View File

@ -49,7 +49,7 @@ export class Et2UrlEmail extends Et2InvokerMixin(Et2Textbox)
static action(value)
{
if (egw.user('apps').mail && egw.preference('force_mailto','addressbook') != '1' )
if (value && egw.user('apps').mail && egw.preference('force_mailto','addressbook') != '1' )
{
egw.open_link('mailto:'+value);
}

View File

@ -51,6 +51,8 @@ export class Et2UrlPhone extends Et2InvokerMixin(Et2Textbox)
// remove everything but numbers and plus, as telephon software might not like it
value = value.replace(/[^0-9+]/g, '');
if (!value) return; // don't try to dial an empty number
// mobile Webkit (iPhone, Android) have precedence over server configuration!
if (navigator.userAgent.indexOf('AppleWebKit') !== -1 &&
(navigator.userAgent.indexOf("iPhone") !== -1 || navigator.userAgent.indexOf("Android") !== -1))