diff options
Diffstat (limited to 'public/static/js/travelynx-actions.js')
-rw-r--r-- | public/static/js/travelynx-actions.js | 11 |
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(); |