tapestry-commits mailing list archives

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

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

ASF subversion and git services commented on TAP5-2380:
-------------------------------------------------------

Commit 38b3aa905bd649e1187d4f60885b0febe6477159 in tapestry-5's branch refs/heads/master from
[~jkemnade]
[ https://git-wip-us.apache.org/repos/asf?p=tapestry-5.git;h=38b3aa9 ]

TAP5-2380: use the correct element in the data-async-trigger link click handler


> [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
>            Assignee: Jochen Kemnade
>              Labels: javascript, jquery
>             Fix For: 5.4
>
>
> 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
(v6.3.4#6332)

Mime
View raw message