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/19 20:25:14 UTC

git commit: TAP5-2202: t5/core/dom:ElementWrapper.attribute() should remove an element when setting its value to null

Updated Branches:
  refs/heads/master 04f0d2563 -> 4551a12a0


TAP5-2202: t5/core/dom:ElementWrapper.attribute() should remove an element when setting its value to null


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

Branch: refs/heads/master
Commit: 4551a12a0724c5d15a7d9d62ca8614c8f45fdfd0
Parents: 04f0d25
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Tue Nov 19 11:25:06 2013 -0800
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Tue Nov 19 11:25:06 2013 -0800

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


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/4551a12a/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 4916690..859dae9 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
@@ -283,18 +283,18 @@ define ["underscore", "./utils", "./events", "jquery"],
     attribute: (name, value) ->
 
       if _.isObject name
-#if jquery
-        @$.attr name
-#elseif prototype
         for attributeName, value of name
           @attribute attributeName, value
-#endif
+
         return this
 
 #if jquery
       current = @$.attr name
       if arguments.length > 1
-        @$.attr name, value
+        if value is null
+          @$.removeAttr name
+        else
+          @$.attr name, value
       if _.isUndefined current
         current = null
 #elseif prototype