summaryrefslogtreecommitdiff
path: root/public/static/js/travelynx-actions.js
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2019-05-12 11:44:28 +0200
committerDaniel Friesel <derf@finalrewind.org>2019-05-12 11:44:28 +0200
commit82297687ed0d056184342541c8af708ee547149f (patch)
tree408e5c762079699d043ab2409891317cb96ddc21 /public/static/js/travelynx-actions.js
parent42eafec28dba956e32ce6f2ffc5f6988e44cfada (diff)
social sharing for current journey1.3.0
Diffstat (limited to 'public/static/js/travelynx-actions.js')
-rw-r--r--public/static/js/travelynx-actions.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/public/static/js/travelynx-actions.js b/public/static/js/travelynx-actions.js
index fd5df02..b4a6b90 100644
--- a/public/static/js/travelynx-actions.js
+++ b/public/static/js/travelynx-actions.js
@@ -138,6 +138,20 @@ function tvly_reg_handlers() {
tvly_run(link, req);
}
});
+ $('.action-share').click(function() {
+ if (navigator.share) {
+ shareObj = {
+ text: $(this).data('text')
+ };
+ if ($(this).data('url')) {
+ shareObj['url'] = $(this).data('url');
+ }
+ navigator.share(shareObj);
+ }
+ });
+ if ($('.action-share').length && !navigator.share) {
+ $('.action-share').css('display', 'none');
+ }
}
$(document).ready(function() {
tvly_reg_handlers();