Changeset 1091
- Timestamp:
- 2007-11-20 03:34:27 (8 months ago)
- Location:
- FCKeditor/trunk/editor/_source
- Files:
-
- 2 modified
-
classes/fckpanel.js (modified) (3 diffs)
-
internals/fcktools.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
FCKeditor/trunk/editor/_source/classes/fckpanel.js
r1089 r1091 192 192 193 193 // Base the popup coordinates upon the coordinates of relElement. 194 var oPos = FCKTools.Get ElementPosition(194 var oPos = FCKTools.GetDocumentPosition( this._Window, 195 195 relElement.nodeType == 9 ? 196 196 ( FCKTools.IsStrictMode( relElement ) ? relElement.documentElement : relElement.body ) : 197 relElement, 198 this._Window ) ; 197 relElement ) ; 199 198 200 199 // Minus the offsets provided by any positioned parent element of the panel iframe. … … 202 201 if ( positionedAncestor ) 203 202 { 204 // GetElementPosition() does not work here for some reason... so I'm using GetDocumentPosition() here instead.205 203 var nPos = FCKTools.GetDocumentPosition( FCKTools.GetElementWindow( positionedAncestor ), positionedAncestor ) ; 206 oPos. X-= nPos.x ;207 oPos. Y-= nPos.y ;204 oPos.x -= nPos.x ; 205 oPos.y -= nPos.y ; 208 206 } 209 207 … … 211 209 x = ( x * -1 ) ; 212 210 213 x += oPos. X;214 y += oPos. Y;211 x += oPos.x ; 212 y += oPos.y ; 215 213 216 214 if ( this.IsRTL ) -
FCKeditor/trunk/editor/_source/internals/fcktools.js
r1017 r1091 424 424 var y = 0 ; 425 425 var curNode = node ; 426 while ( curNode && curNode != w.document.body ) 426 var prevNode = null ; 427 var curWindow = FCKTools.GetElementWindow( curNode ) ; 428 while ( curNode && !( curWindow == w && curNode == w.document.body ) ) 427 429 { 428 430 x += curNode.offsetLeft - curNode.scrollLeft ; 429 431 y += curNode.offsetTop - curNode.scrollTop ; 430 curNode = curNode.offsetParent ; 431 } 432 433 if ( ! FCKBrowserInfo.IsOpera ) 434 { 435 var scrollNode = prevNode ; 436 while ( scrollNode && scrollNode != curNode ) 437 { 438 x -= scrollNode.scrollLeft ; 439 y -= scrollNode.scrollTop ; 440 scrollNode = scrollNode.parentNode ; 441 } 442 } 443 444 prevNode = curNode ; 445 if ( curNode.offsetParent ) 446 curNode = curNode.offsetParent ; 447 else 448 { 449 if ( curWindow != w ) 450 { 451 curNode = curWindow.frameElement ; 452 prevNode = null ; 453 if ( curNode ) 454 curWindow = FCKTools.GetElementWindow( curNode ) ; 455 } 456 else 457 curNode = null ; 458 } 459 } 460 x += w.document.body.offsetLeft ; 461 y += w.document.body.offsetTop ; 432 462 return { "x" : x, "y" : y } ; 433 463 }