The code seems ok. The two event handlers should work independently.
Any chance I could try out your extension?
Sebastian
On Saturday, March 1, 2014 10:55:52 AM UTC+1, Dan wrote:
>
> Hi,
>
> I'm creating a Firebug extension and struggling with domplate events.
>
> Given 2 separate elements, each with a separate onclick handler, the same
> handler (onBtnOneClick) is called for both elements.
>
> Sure, I could check the event.target, but the ui is going to get a lot
> more complicated than this, and surely I should be able to attach different
> handlers to different elements?
>
> See the template (some of it) below.
>
> FYI, if I delete btnOne, then onBnTwoClick is called when btnTwo is
> clicked.
>
> Is this a bug, expected behaviour, or am I doing something else wrong?
>
> var MyPlate = domplate({
>
> ui:
> TABLE({"class" : "stretch"},
> TR(
> TD({"class" : "fit nowrap"},
>
> A({"class" : "btn flush", "id" : "btnOne", onclick :
> "$onBtnOneClick"},
> SPAN({"class" : "icon one"}),
> " One"
> ),
>
> A({"class" : "btn", "id" : "btnTwo", onclick :
> "$onBtnTwoClick"},
> SPAN({"class" : "icon select"}),
> " Two"
> )
> ),
> ......
>
>
>
--
You received this message because you are subscribed to the Google Groups
"Firebug" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/firebug.
To view this discussion on the web visit
https://groups.google.com/d/msgid/firebug/5f029219-d5c0-4aaa-8ee7-81fc724f6411%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.