You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2015/04/01 17:31:53 UTC
[jira] [Commented] (WICKET-5869) Kittencaptcha doesn't calculate
click y-coordinate correctly
[ https://issues.apache.org/jira/browse/WICKET-5869?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14390808#comment-14390808 ]
ASF subversion and git services commented on WICKET-5869:
---------------------------------------------------------
Commit 51b704f3557f12e5bbb5b3e45987fdfa00a78d0d in wicket's branch refs/heads/wicket-6.x from [~dashorst]
[ https://git-wip-us.apache.org/repos/asf?p=wicket.git;h=51b704f ]
Fixed WICKET-5869: KittenCaptcha doesnt calculate Y-position correctly in FireFox
> Kittencaptcha doesn't calculate click y-coordinate correctly
> ------------------------------------------------------------
>
> Key: WICKET-5869
> URL: https://issues.apache.org/jira/browse/WICKET-5869
> Project: Wicket
> Issue Type: Bug
> Components: wicket-extensions
> Affects Versions: 6.14.0, 6.15.0, 6.16.0, 6.17.0, 6.18.0, 6.19.0
> Reporter: Martijn Dashorst
> Priority: Minor
> Fix For: 6.20.0, 7.0.0-M6
>
>
> In firefox the click event doesn't calculate the relative position of the click correctly.
> In the block when the event doesn't have an offsetX/Y, the code should take into account all offsets of all offsetParents. The code below fixes this.
> {code:javascript}
> function getEventX(element, event) {
> var result;
> if (event.offsetX != null) {
> result = event.offsetX;
> } else {
> result = event.pageX;
> do {
> result = result - element.offsetLeft;
> element = element.offsetParent;
> } while (element != null)
> }
> return parseInt(result, 10);
> }
> function getEventY(element, event) {
> var result;
> if (event.offsetY != null) {
> result = event.offsetY;
> } else {
> result = event.pageY;
> do {
> result = result - element.offsetTop;
> element = element.offsetParent;
> } while (element != null)
> }
> return parseInt(result, 10);
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)