diff --git a/resources/assets/js/components.js b/resources/assets/js/components.js index 50aa36bd..3acb4398 100644 --- a/resources/assets/js/components.js +++ b/resources/assets/js/components.js @@ -25,6 +25,13 @@ pixelfed.readmore = () => { }); }; +try { + document.createEvent("TouchEvent"); + $('body').addClass('touch'); +} catch (e) { + return false; +} + window.InfiniteScroll = require('infinite-scroll'); window.filesize = require('filesize'); window.Plyr = require('plyr'); @@ -137,10 +144,10 @@ window.pixelfed.copyToClipboard = (str) => { const el = document.createElement('textarea'); el.value = str; el.setAttribute('readonly', ''); - el.style.position = 'absolute'; + el.style.position = 'absolute'; el.style.left = '-9999px'; document.body.appendChild(el); - const selected = + const selected = document.getSelection().rangeCount > 0 ? document.getSelection().getRangeAt(0) : false; @@ -162,4 +169,4 @@ $(document).ready(function() { const warningTitleCSS = 'color:red; font-size:60px; font-weight: bold; -webkit-text-stroke: 1px black;'; const warningDescCSS = 'font-size: 18px;'; console.log('%cStop!', warningTitleCSS); -console.log("%cThis is a browser feature intended for developers. If someone told you to copy and paste something here to enable a Pixelfed feature or \"hack\" someone's account, it is a scam and will give them access to your Pixelfed account.", warningDescCSS); \ No newline at end of file +console.log("%cThis is a browser feature intended for developers. If someone told you to copy and paste something here to enable a Pixelfed feature or \"hack\" someone's account, it is a scam and will give them access to your Pixelfed account.", warningDescCSS); diff --git a/resources/assets/js/components/PostComponent.vue b/resources/assets/js/components/PostComponent.vue index c3b9f625..cba5e9d6 100644 --- a/resources/assets/js/components/PostComponent.vue +++ b/resources/assets/js/components/PostComponent.vue @@ -56,11 +56,11 @@