summaryrefslogtreecommitdiff
path: root/public/static/js/travelynx-actions.js
diff options
context:
space:
mode:
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();