]> gitweb.michael.orlitzky.com - charm-bypass.git/commitdiff
index.html.in: make ticket taps do nothing
authorMichael Orlitzky <michael@orlitzky.com>
Wed, 10 Sep 2025 23:26:47 +0000 (19:26 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Wed, 10 Sep 2025 23:26:47 +0000 (19:26 -0400)
Tapping the ticket (anything but the QR code) in CharmPass does
nothing; i.e. it does not change the background from day to night.
We mimic that with a dummy click handler on the ticket.

index.html.in

index 3fe12944b7bb16af297e7e742c093bac826a9d93..3d024409d845cb34b89bef900983dbe259bd5908 100644 (file)
         /* Focus (grow) or unfocus (ungrow) the QR code */
         document.getElementById("qr").addEventListener("click",
                                                        toggle_qr_focus);
+
+        /* Dummy handler to prevent taps on the ticket from
+         * swapping day and night. Events bubble "up" by default
+         * so, even though the QR code is part of the ticket,
+         * taps on the QR should still be handled. */
+        document.getElementById("ticket").addEventListener(
+          "click",
+          event => { event.stopPropagation(); }
+        );
       }
       else {
         /* If we haven't submitted the form yet, set up change handlers