Ticket #135: fcktools_gecko.js.patch
File fcktools_gecko.js.patch, 1.6 KB (added by , 17 years ago) |
---|
-
fcktools_gecko.js
old new 189 189 // Get the coordinates of an element. 190 190 // @el : The element to get the position. 191 191 // @relativeWindow: The window to which we want the coordinates relative to. 192 FCKTools.GetElementPosition = function( el, relativeWindow )192 FCKTools.GetElementPosition = function( el, relativeWindow, excludeParentChain ) 193 193 { 194 194 // Initializes the Coordinates object that will be returned by the function. 195 195 var c = { X:0, Y:0 } ; … … 197 197 var oWindow = relativeWindow || window ; 198 198 199 199 var oOwnerWindow = FCKTools.GetElementWindow( el ) ; 200 201 var elOrig = el; 200 202 201 203 // Loop throw the offset chain. 202 204 while ( el ) … … 229 231 } 230 232 } 231 233 } 234 235 if (excludeParentChain == null){ 236 excludeParentChain = true; 237 } 238 239 // Loop through the parent chain. 240 if (excludeParentChain && elOrig) { 241 var oOwnerWindow = FCKTools.GetElementWindow( elOrig ) ; 242 while(elOrig){ 243 if (elOrig.parentNode) { 244 if (elOrig.parentNode.scrollTop) 245 c.Y -= elOrig.parentNode.scrollTop; 246 if (elOrig.parentNode.scrollLeft) 247 c.X -= elOrig.parentNode.scrollLeft; 248 elOrig = elOrig.parentNode; 249 } else { 250 if ( oOwnerWindow != oWindow ){ 251 elOrig = oOwnerWindow.frameElement; 252 if ( elOrig ) 253 oOwnerWindow = FCKTools.GetElementWindow( elOrig ); 254 } else { 255 break ; 256 } 257 } 258 } 259 } 232 260 233 261 // Return the Coordinates object 234 262 return c ;