Changeset 12117
- Timestamp:
- 01/21/08 17:14:50 (12 months ago)
- Files:
-
- 1 modified
-
dojo/trunk/_base/html.js (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dojo/trunk/_base/html.js
r12116 r12117 845 845 dojo._abs = function(/*DomNode*/node, /*Boolean?*/includeScroll){ 846 846 // summary: 847 // Gets the absolute position of the passed element based on the 848 // document itself. Returns an object of the form: 847 // Gets the position of the passed element relative to 848 // the viewport (if includeScroll==false), or relative to the 849 // document root (if includeScroll==true). 850 // 851 // Returns an object of the form: 849 852 // { x: 100, y: 300 } 850 853 // if includeScroll is passed, the x and y values will include any … … 859 862 y: 0 860 863 }; 861 var hasScroll = false;862 864 863 865 // targetBoxType == "border-box" … … 876 878 }else{ 877 879 if(node["offsetParent"]){ 878 hasScroll = true;879 880 var endNode; 880 881 // in Safari, if the node is an absolutely positioned child of … … 893 894 if(node.parentNode != db){ 894 895 var nd = node; 895 if(dojo.isOpera || (dojo.isSafari >= 3)){ nd = db; }896 if(dojo.isOpera){ nd = db; } 896 897 ret.x -= _sumAncestorProperties(nd, "scrollLeft"); 897 898 ret.y -= _sumAncestorProperties(nd, "scrollTop"); … … 918 919 // if offsetParent is used, ret value already includes scroll position 919 920 // so we may have to actually remove that value if !includeScroll 920 if( hasScroll ||includeScroll){921 if(includeScroll){ 921 922 var scroll = dojo._docScroll(); 922 var m = hasScroll ? (!includeScroll ? -1 : 0) : 1; 923 ret.y += m*scroll.y; 924 ret.x += m*scroll.x; 923 ret.y += scroll.y; 924 ret.x += scroll.x; 925 925 } 926 926