You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by hl...@apache.org on 2013/11/25 21:11:20 UTC

[4/5] git commit: Fix incorrect return value from the jQuery version of ElementWrapper:trigger()

Fix incorrect return value from the jQuery version of ElementWrapper:trigger()

The result was inverted; one side-effect is that forms that contained input validations would round-trip to the server anyway.


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/f270cbc9
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/f270cbc9
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/f270cbc9

Branch: refs/heads/master
Commit: f270cbc918b0721ca4b971bb6d61b4556dfd52e0
Parents: a5de2b6
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Mon Nov 25 12:10:45 2013 -0800
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Mon Nov 25 12:10:45 2013 -0800

----------------------------------------------------------------------
 .../org/apache/tapestry5/t5-core-dom.coffee                     | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/f270cbc9/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 f1a7afb..2cec0cc 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
@@ -117,8 +117,8 @@ define ["underscore", "./utils", "./events", "jquery"],
     # as well as DOM event bubbling.
     stop: ->
 #if jquery
-      @nativeEvent.stopImmediatePropagation()
       @nativeEvent.preventDefault()
+      @nativeEvent.stopImmediatePropagation()
 #elseif prototype
       @nativeEvent.stop()
 #endif
@@ -538,8 +538,7 @@ define ["underscore", "./utils", "./events", "jquery"],
 
       @$.trigger jqEvent, memo
 
-      # Not sure if this is sufficient to ensure that event was cancelled:
-      return jqEvent.isImmediatePropagationStopped()
+      return not jqEvent.isImmediatePropagationStopped()
 #elseif prototype
       if (eventName.indexOf ':') > 0
         # Custom event is supported directly by Prototype: