Skip to content
This repository was archived by the owner on Mar 7, 2022. It is now read-only.

Commit 9ab9907

Browse files
authored
Update angular-socialshare.js
1 parent 5301335 commit 9ab9907

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

lib/angular-socialshare.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -820,10 +820,15 @@
820820
$log.warn('sending sms text with "%" sign is not supported');
821821
}
822822

823-
var body = encodeURIComponent(attrs.socialshareText.replace('%','')) + encodeURIComponent(attrs.socialshareUrl)
824-
, toPhoneNumber = attrs.socialshareTo || ''
825-
, urlString = 'sms:' + toPhoneNumber + '?&body=' + body;
826-
823+
var body = encodeURIComponent(attrs.socialshareText.replace('%',''))
824+
, toPhoneNumber = attrs.socialshareTo || '';
825+
826+
if (attrs.socialshareUrl) {
827+
body += encodeURIComponent(attrs.socialshareUrl);
828+
}
829+
830+
var urlString = 'sms:' + toPhoneNumber + '?&body=' + body;
831+
827832
element.attr('href', urlString);
828833
element.attr('target', '_blank');
829834
}

0 commit comments

Comments
 (0)