tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jochen Kemnade (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (TAP5-2380) [JavaScript][t5/core/dom] missused target on eventlink
Date Tue, 02 Sep 2014 12:39:21 GMT

    [ https://issues.apache.org/jira/browse/TAP5-2380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14118144#comment-14118144

Jochen Kemnade commented on TAP5-2380:

Same problem as in TAP5-2183 and TAP5-2233. Maybe we should bind {{this}} to the *matched*
element instead of the one that the event occurred on.

> [JavaScript][t5/core/dom] missused target on eventlink
> ------------------------------------------------------
>                 Key: TAP5-2380
>                 URL: https://issues.apache.org/jira/browse/TAP5-2380
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.4
>            Reporter: Charles Capon
>              Labels: javascript, jquery
> Setup: t5.4-beta-15 with jquery only.
> I used an EventLink like this :
> {code:xml}
> <t:eventlink t:event="saveATree" async="true" id="saveButton" class="btn btn-success">
>     <span class="fa fa-tree" />
>     <span class="hidden-xs hidden-sm">Sauver un arbre</span>
> </t:eventlink>
> {code}
> I think i got it right because it works when I click on it until I precisely click on
the icon or the text. Then, it doesn't call the url I want it to.
> I debugged the js code and it appears that in the jquery.event, the property target is
the actual clicked element (in my example, the span). So when the callback is called, this
equal to my span element and does not contain any href attribute.
> I can't provide a patch but the fix is quite simple... you just need to use the currentTarget
property instead of target in the event wrapper (line 148 in t5-core-dom.coffee). I also think
that it should be easy to write a test for this bug.

This message was sent by Atlassian JIRA

View raw message