Skip to content

Commit

Permalink
Remove mandatory "+" on tel: links
Browse files Browse the repository at this point in the history
  • Loading branch information
samthejarvis committed May 7, 2021
1 parent dd4cff3 commit b11a742
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Forms/LinkItemField.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public function LinkItemForm()
->addExtraClass('link-hidden link-external'),
EmailField::create('Email', 'Email (without mailto:)')
->addExtraClass('link-hidden link-email'),
TextField::create('Telephone', 'Telephone (without +)')
TextField::create('Telephone', 'Telephone')
->addExtraClass('link-hidden link-telephone'),
UploadField::create('File', 'File')
->addExtraClass('link-hidden link-file')
Expand Down
4 changes: 2 additions & 2 deletions src/Model/LinkItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public function getCMSFields()
->hideUnless('LinkType')->isEqualTo('external')->end(),
EmailField::create('Email', 'Email (without mailto:)')
->hideUnless('LinkType')->isEqualTo('email')->end(),
TextField::create('Telephone', 'Telephone (without +)')
TextField::create('Telephone', 'Telephone')
->hideUnless('LinkType')->isEqualTo('telephone')->end(),
UploadField::create('File', 'File')
->setFolderName('Uploads')
Expand Down Expand Up @@ -189,7 +189,7 @@ public function Link()
$link = 'mailto:'.$this->Email;
break;
case 'telephone':
$link = 'tel:+'.$this->Telephone;
$link = 'tel:'.$this->Telephone;
break;
case 'file':
$link = $this->File()->URL;
Expand Down

0 comments on commit b11a742

Please sign in to comment.