Updated Branches:
  refs/heads/master e6448089c -> f6d06a3bb

Add a ElementWrapper.css() to get or set a CSS property name


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

Branch: refs/heads/master
Commit: f6d06a3bb0e3803ec3366bb4d7c49268a9be840b
Parents: e644808
Author: Howard M. Lewis Ship <[email protected]>
Authored: Fri Jun 14 15:27:21 2013 -0700
Committer: Howard M. Lewis Ship <[email protected]>
Committed: Fri Jun 14 15:27:21 2013 -0700

----------------------------------------------------------------------
 .../org/apache/tapestry5/t5-core-dom-jquery.coffee       | 11 +++++++++++
 .../org/apache/tapestry5/t5-core-dom-prototype.coffee    | 10 ++++++++++
 2 files changed, 21 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/f6d06a3b/tapestry-core/src/main/coffeescript/org/apache/tapestry5/t5-core-dom-jquery.coffee
----------------------------------------------------------------------
diff --git 
a/tapestry-core/src/main/coffeescript/org/apache/tapestry5/t5-core-dom-jquery.coffee
 
b/tapestry-core/src/main/coffeescript/org/apache/tapestry5/t5-core-dom-jquery.coffee
index 80cc099..11918d9 100644
--- 
a/tapestry-core/src/main/coffeescript/org/apache/tapestry5/t5-core-dom-jquery.coffee
+++ 
b/tapestry-core/src/main/coffeescript/org/apache/tapestry5/t5-core-dom-jquery.coffee
@@ -139,6 +139,17 @@ define ["underscore", "./utils", "jquery", "./events"], 
(_, utils, $, events) ->
 
       return this
 
+    # Gets or sets a CSS property. jQuery provides a lot of mapping of names 
to canonical names.
+    css: (name, value) ->
+
+      if arguments.length is 1
+        return @$.css name
+
+      @$.css name, value
+
+      return this
+
+
     # Removes the wrapped element from the DOM.  It can later be re-attached.
     remove: ->
       # jQuery's remove() will remove event handlers which we don't want.

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/f6d06a3b/tapestry-core/src/main/coffeescript/org/apache/tapestry5/t5-core-dom-prototype.coffee
----------------------------------------------------------------------
diff --git 
a/tapestry-core/src/main/coffeescript/org/apache/tapestry5/t5-core-dom-prototype.coffee
 
b/tapestry-core/src/main/coffeescript/org/apache/tapestry5/t5-core-dom-prototype.coffee
index 04c7b37..e4278e2 100644
--- 
a/tapestry-core/src/main/coffeescript/org/apache/tapestry5/t5-core-dom-prototype.coffee
+++ 
b/tapestry-core/src/main/coffeescript/org/apache/tapestry5/t5-core-dom-prototype.coffee
@@ -182,6 +182,16 @@ define ["underscore", "./utils", "./events", "prototype"], 
(_, utils, events) ->
 
       return this
 
+    # Gets or sets a CSS property.
+    css: (name, value) ->
+
+      if arguments.length is 1
+        return @element.getStyle name
+
+      @element.setStyle name: value
+
+      return this
+
     # Removes the wrapped element from the DOM.  It can later be re-attached.
     remove: ->
       @element.remove()

Reply via email to