Add touch support to event

Discussion forum for Extension Writers regarding Extension Development.
Post Reply
User avatar
Ger
Recognised Extension Developer
Posts: 1737
Joined: Wed Jan 02, 2008 7:35 pm
Location: 192.168.1.100
Contact:

Add touch support to event

Post by Ger » Thu Sep 06, 2018 9:46 am

For my Modern Quote extension it was pointed out to me that it doesn't work fully on mobile devices due to lack of touch support. I've looked into it, but it boils down to this JS function: https://github.com/GerB/modernquote/blo ... #L103-L119

This is triggered by the mouseup event in the .postbody .content element. Since phones and tablets don't have mouses, the event isn't triggered. Googling tells me there are events like touchup but I can't get them to work. The console tells me that it's not a function.
I would think this is a trivial issue, but I'm struggling right now. Can somebody guide me into the right direction?
My extensions:
Simple CMS, Feed post bot, Avatar Resize, Modbreak, Magic OGP, Live topic update, Modern Quote, Quoted Where (GDPR) and Autoresponder.
Newest: FAQ manager for 3.2

Like my work? Buy me a coffee to keep it coming. :ugeek:
-Available for custom work-

User avatar
kinerity
Community Team Member
Community Team Member
Posts: 1900
Joined: Mon Sep 01, 2014 1:00 am
Location: sudo rm -rf /
Name: Kailey Truscott
Contact:

Re: Add touch support to event

Post by kinerity » Thu Sep 06, 2018 4:45 pm

This doesn't list touchup as an event. Maybe you're looking for touchstart and touchend?
Kailey Truscott - Community Team

User avatar
Ger
Recognised Extension Developer
Posts: 1737
Joined: Wed Jan 02, 2008 7:35 pm
Location: 192.168.1.100
Contact:

Re: Add touch support to event

Post by Ger » Fri Sep 07, 2018 9:07 am

Well, thank you! :D
It took me a couple of hours to get everything straight, but I finally got everything working. I went for this: https://github.com/GerB/modernquote/blo ... #L129-L137
My extensions:
Simple CMS, Feed post bot, Avatar Resize, Modbreak, Magic OGP, Live topic update, Modern Quote, Quoted Where (GDPR) and Autoresponder.
Newest: FAQ manager for 3.2

Like my work? Buy me a coffee to keep it coming. :ugeek:
-Available for custom work-

Post Reply

Return to “Extension Writers Discussion”

Who is online

Users browsing this forum: No registered users and 20 guests