Is this the Jupyter Notebook, JupyterLab, or some other front end with
notebooks?

Do you want to just see every click, or do you want to override
functionality from Jupyter? If you just want to see the clicks, you can
register a click handler in the capture phase of the DOM events. See
https://www.w3.org/TR/DOM-Level-3-Events/#event-flow or
https://developer.mozilla.org/en-US/docs/Web/API/Event/eventPhase or
https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Building_blocks/Events#Event_bubbling_and_capture
for more information. If you want to override Jupyter functionality, then
it entirely depends on what you want to do and what frontend you are
working in.

Thanks,

Jason


On Tue, Mar 24, 2020 at 1:37 PM Dario Panada <[email protected]> wrote:

> Any suggestion around this? For context, I am trying to hide some code
> comments but every time I click they reappear.
>
> Kind regards
> Dario
>
> On Tuesday, March 24, 2020, Jason Grout <[email protected]> wrote:
>
>> My guess is that the thing handling clicks in the notebook is stopping
>> propagation of the click event up to the window?
>>
>> Jason
>>
>>
>> On Tue, Mar 24, 2020 at 12:31 PM Dario Panada <[email protected]>
>> wrote:
>>
>>> Hello,
>>>
>>> I am creating a Jupyter extension to register clicks anywhere on the
>>> notebook webpage. I am using:
>>>
>>> $(window).click(() => console.log("click"));
>>>
>>>
>>> That works for any click, *except* the first click on an un-selected
>>> code cell. Once that becomes selected, further clicks register normally.
>>>
>>> Any advice as to why?
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Project Jupyter" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/jupyter/d89c9b46-14dc-424f-bcc8-d2aeeb528a93%40googlegroups.com
>>> <https://groups.google.com/d/msgid/jupyter/d89c9b46-14dc-424f-bcc8-d2aeeb528a93%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Project Jupyter" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/jupyter/CAPDWZHx6nPmxFaq-BaiYd35tWqT6id66Pkkiu5WMCQsw8T8QGg%40mail.gmail.com
>> <https://groups.google.com/d/msgid/jupyter/CAPDWZHx6nPmxFaq-BaiYd35tWqT6id66Pkkiu5WMCQsw8T8QGg%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Project Jupyter" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jupyter/CAByD6GMuHQcLEVJWyK3Afo_ZZryg9akx%2B0uCfrGqqXD5-sY4jA%40mail.gmail.com
> <https://groups.google.com/d/msgid/jupyter/CAByD6GMuHQcLEVJWyK3Afo_ZZryg9akx%2B0uCfrGqqXD5-sY4jA%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/CAPDWZHxjNb9NT9YKb9RDcR%3DNdjANs9AOOXgqNLTbzAXkiGvz1g%40mail.gmail.com.

Reply via email to