Changeset 1089
- Timestamp:
- 2007-11-19 08:59:39 (9 months ago)
- Location:
- FCKeditor/trunk/editor/_source
- Files:
-
- 2 modified
-
classes/fckpanel.js (modified) (2 diffs)
-
internals/fckdomtools.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
FCKeditor/trunk/editor/_source/classes/fckpanel.js
r922 r1089 191 191 iMainWidth = eMainNode.offsetWidth || eMainNode.firstChild.offsetWidth ; 192 192 193 // Base the popup coordinates upon the coordinates of relElement. 193 194 var oPos = FCKTools.GetElementPosition( 194 195 relElement.nodeType == 9 ? … … 197 198 this._Window ) ; 198 199 200 // Minus the offsets provided by any positioned parent element of the panel iframe. 201 var positionedAncestor = FCKDomTools.GetPositionedAncestor( FCKTools.GetElementWindow( this._IFrame ), this._IFrame.parentNode ) ; 202 if ( positionedAncestor ) 203 { 204 // GetElementPosition() does not work here for some reason... so I'm using GetDocumentPosition() here instead. 205 var nPos = FCKTools.GetDocumentPosition( FCKTools.GetElementWindow( positionedAncestor ), positionedAncestor ) ; 206 oPos.X -= nPos.x ; 207 oPos.Y -= nPos.y ; 208 } 209 199 210 if ( this.IsRTL && !this.IsContextMenu ) 200 211 x = ( x * -1 ) ; -
FCKeditor/trunk/editor/_source/internals/fckdomtools.js
r1086 r1089 920 920 for ( var styleName in styleDict ) 921 921 style[ styleName ] = styleDict[ styleName ] ; 922 }, 923 924 GetCurrentElementStyle : function( w, element, attrName ) 925 { 926 if ( FCKBrowserInfo.IsIE ) 927 return element.currentStyle[attrName] ; 928 else 929 return w.getComputedStyle( element, '' )[attrName] ; 930 }, 931 932 GetPositionedAncestor : function( w, element ) 933 { 934 var currentElement = element ; 935 while ( currentElement != currentElement.ownerDocument.documentElement ) 936 { 937 if ( this.GetCurrentElementStyle( w, currentElement, 'position' ) != 'static' ) 938 return currentElement ; 939 currentElement = currentElement.parentNode ; 940 } 941 return null ; 922 942 } 923 943 } ;