You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by jk...@apache.org on 2017/04/06 09:17:41 UTC
tapestry-5 git commit: TAP5-2225: properly handle ElementWrapper
instances
Repository: tapestry-5
Updated Branches:
refs/heads/master 3b1d5a3e0 -> 98e163818
TAP5-2225: properly handle ElementWrapper instances
Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/98e16381
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/98e16381
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/98e16381
Branch: refs/heads/master
Commit: 98e163818ba70989160f1856d363dae85db8ccab
Parents: 3b1d5a3
Author: Jochen Kemnade <jo...@eddyson.de>
Authored: Thu Apr 6 11:17:17 2017 +0200
Committer: Jochen Kemnade <jo...@eddyson.de>
Committed: Thu Apr 6 11:17:17 2017 +0200
----------------------------------------------------------------------
.../org/apache/tapestry5/t5-core-dom.coffee | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/98e16381/tapestry-core/src/main/preprocessed-coffeescript/org/apache/tapestry5/t5-core-dom.coffee
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/preprocessed-coffeescript/org/apache/tapestry5/t5-core-dom.coffee b/tapestry-core/src/main/preprocessed-coffeescript/org/apache/tapestry5/t5-core-dom.coffee
index d6bbf2e..c014c89 100644
--- a/tapestry-core/src/main/preprocessed-coffeescript/org/apache/tapestry5/t5-core-dom.coffee
+++ b/tapestry-core/src/main/preprocessed-coffeescript/org/apache/tapestry5/t5-core-dom.coffee
@@ -906,11 +906,13 @@ define ["underscore", "./utils", "./events", "jquery"],
eventName = eventName.toLowerCase()
- if element instanceof jQuery
+ if element is null
+ element = document.body
+ else if element instanceof jQuery
element = element[0];
+ else if element instanceof ElementWrapper
+ element = element.element;
- if element is null
- element = document.getElementsByTagName('body')[0]
# Look for event data in itself first, then in the preceding siblings
# if not found