Hi everyone,

Lately I've started looking into Gnoga again for web development.
Sad to hear about Davids health issue but glad he feels better and on the road 
to recovery.
I recently ran into the issue of mouse click event propagation.
What is the best way to stop mouse clicks to bubble up the DOM
in one's application? I've successfully used the hack that was
suggested by Olivier (after David had suggested something similar).
There is also a comment by David on improving the situation in 2015.
My guess is that the hack is still the best way to go about it.
I've added the following subprogram in my project:

   procedure Connect_Click_Handler
     (Element : in out Gnoga.Gui.Base.Base_Type'Class;
      Handler : in     Gnoga.Gui.Base.Action_Event) is
   begin
      Element.On_Click_Handler (Handler => Handler);
      Element.Bind_Event_Script
        (Event  => "click",
         Script => "e.stopPropagation()");
   end Connect_Click_Handler;

It works for me but would be cool if there was some subprogram
in Gnoga one could call directly instead of making two
subprogram calls to the Gnoga framework.

Best regards,
Joakim

> 2015-12-02 03:04:45
>
> It should be doable to add a Propagate_Events property in Gnoga.Gui.Base,
> I'll add it soon.
>
> David Botton


On Tue, Dec 1, 2015 at 9:29 PM Olivier Henley <olivier.henley@...>
wrote:

> No it did not.
>
> ... but found a hack that works, namely binding a script, at creation, to
> stop propagation directly at the browser level:
>
> Trash_Div.On_Click_Handler (App.Controller.On_Click_Trash_Clip'Access);
>
> Trash_Div.Bind_Event_Script (Event  => "click",
>                                            Script =>
> "e.stopPropagation()");
>
> Thx.

_______________________________________________
Gnoga-list mailing list
Gnoga-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gnoga-list

Reply via email to