tapestry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hls...@apache.org
Subject [1/4] git commit: Add ElementWrapper.offset()
Date Tue, 18 Jun 2013 01:30:47 GMT
Updated Branches:
  refs/heads/master f6d06a3bb -> 5e22b236f


Add ElementWrapper.offset()


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

Branch: refs/heads/master
Commit: d5e74693e6a85c7d1ef9d2ab03203e70525d2477
Parents: f6d06a3
Author: Howard M. Lewis Ship <hlship@apache.org>
Authored: Fri Jun 14 17:30:08 2013 -0700
Committer: Howard M. Lewis Ship <hlship@apache.org>
Committed: Fri Jun 14 17:30:08 2013 -0700

----------------------------------------------------------------------
 .../coffeescript/org/apache/tapestry5/t5-core-dom-jquery.coffee | 4 ++++
 .../org/apache/tapestry5/t5-core-dom-prototype.coffee           | 5 +++++
 2 files changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/d5e74693/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 11918d9..b1ddbfc 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
@@ -149,6 +149,10 @@ define ["underscore", "./utils", "jquery", "./events"], (_, utils, $,
events) ->
 
       return this
 
+    # Returns the offset of the object relative to the document. The returned object has
+    # keys `top`' and `left`'.
+    offset: ->
+      @$.offset()
 
     # Removes the wrapped element from the DOM.  It can later be re-attached.
     remove: ->

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/d5e74693/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 e4278e2..db88bbb 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
@@ -192,6 +192,11 @@ define ["underscore", "./utils", "./events", "prototype"], (_, utils,
events) ->
 
       return this
 
+    # Returns the offset of the object relative to the document. The returned object has
+    # keys `top`' and `left`'.
+    offset: ->
+      @element.viewportOffset()
+
     # Removes the wrapped element from the DOM.  It can later be re-attached.
     remove: ->
       @element.remove()


Mime
View raw message