summaryrefslogtreecommitdiff
path: root/public/static/js/travelynx-actions.js
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2019-11-14 18:23:21 +0100
committerDaniel Friesel <daniel.friesel@uos.de>2019-11-14 18:23:21 +0100
commit35e9dae3499a4234836a2f858797e7b05f5d12c6 (patch)
tree125accece1a940a8d1b7fd7bc4a1c45bfa4575c2 /public/static/js/travelynx-actions.js
parent3e61b9de48b7285b172d406cd3cb8f75e086e83a (diff)
include URL in copied share text if enabled1.9.12
Diffstat (limited to 'public/static/js/travelynx-actions.js')
-rw-r--r--public/static/js/travelynx-actions.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/public/static/js/travelynx-actions.js b/public/static/js/travelynx-actions.js
index d6ceb87..7f60df6 100644
--- a/public/static/js/travelynx-actions.js
+++ b/public/static/js/travelynx-actions.js
@@ -203,16 +203,20 @@ function tvly_reg_handlers() {
});
$('.action-share').click(function() {
var text = $(this).data('text');
+ var url = $(this).data('url');
if (navigator.share) {
shareObj = {
text: text
};
- if ($(this).data('url')) {
- shareObj['url'] = $(this).data('url');
+ if (url) {
+ shareObj['url'] = url;
}
navigator.share(shareObj);
} else {
var el = document.createElement('textarea');
+ if (url) {
+ text += ' ' + url;
+ }
el.value = text;
el.setAttribute('readonly', '');
el.style.position = 'absolute';
@@ -225,9 +229,6 @@ function tvly_reg_handlers() {
M.toast({html: 'Text kopiert: „' + text + '“'});
}
});
- if ($('.action-share').length && !navigator.share && !$('.action-share').data('url')) {
- $('.action-share').css('display', 'none');
- }
}
$(document).ready(function() {
tvly_reg_handlers();