dascritch / cpu-audio

An audio WebComponent to provide timecoded links and other features to an audio tag
https://dascritch.github.io/cpu-audio/
GNU Lesser General Public License v3.0
24 stars 2 forks source link

Alternative fine browsing mode on Safari #150

Closed dascritch closed 3 years ago

dascritch commented 3 years ago

Event delegation not standardly occuring. May be I should add a listener out of contextmenu. So bad, because it was so simple and elegant

dascritch commented 3 years ago

Most of the recipes is to recreate a timer listener. But this is interesting https://github.com/Leaflet/Leaflet/issues/6817 then https://bugs.webkit.org/show_bug.cgi?id=202143 . As we use pointer events for the throbber, I have to re-emulate the contextmenu event. I had it, but removed.

So sad... it was leaner

    // throbber management
    const timeline_element = elCPU.shadowId('time');
    timeline_element?.addEventListener('pointerenter', trigger.hover, passiveEvent);
    timeline_element?.addEventListener('pointermove', trigger.hover, passiveEvent);
    timeline_element?.addEventListener('pointerout', trigger.out, passiveEvent);
    // alternative fine navigation for handhelds
    timeline_element?.addEventListener('contextmenu', () => {elCPU.showHandheldNav();});