This repository was archived by the owner on Mar 7, 2022. It is now read-only.
File tree 2 files changed +11
-5
lines changed
2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -404,8 +404,9 @@ Method | Option | Type | Default | Description
404
404
405
405
Method | Option | Type | Default | Description
406
406
------------- | ------------- | ------------- | ------------- | -------------
407
- sharer | socialshare-to="" | URL | page URL | Set the phone number of the contact
407
+ sharer | socialshare-to="" | URL | false | Set the phone number of the contact
408
408
sharer | socialshare-text="" | String | false | Set the content to share
409
+ sharer | socialshare-url="" | URL | page URL| Set the url to share
409
410
410
411
##Options
411
412
Original file line number Diff line number Diff line change 820
820
$log . warn ( 'sending sms text with "%" sign is not supported' ) ;
821
821
}
822
822
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
+
827
832
element . attr ( 'href' , urlString ) ;
828
833
element . attr ( 'target' , '_blank' ) ;
829
834
}
You can’t perform that action at this time.
0 commit comments