Ticket #1769: 1769.patch

File 1769.patch, 3.2 KB (added by Frederico Caldeira Knabben, 16 years ago)
  • editor/_source/classes/fckpanel.js

     
    217217                                relElement ) ;
    218218
    219219                // Minus the offsets provided by any positioned parent element of the panel iframe.
    220                 var positionedAncestor = FCKDomTools.GetPositionedAncestor( FCKTools.GetElementWindow( this._IFrame ), this._IFrame.parentNode ) ;
     220                var positionedAncestor = FCKDomTools.GetPositionedAncestor( this._IFrame.parentNode ) ;
    221221                if ( positionedAncestor )
    222222                {
    223223                        var nPos = FCKTools.GetDocumentPosition( FCKTools.GetElementWindow( positionedAncestor ), positionedAncestor ) ;
  • editor/_source/internals/fckdomtools.js

     
    924924                        style[ styleName ] = styleDict[ styleName ] ;
    925925        },
    926926
    927         GetCurrentElementStyle : function( w, element, attrName )
     927        GetCurrentElementStyle : function( element, propertyName )
    928928        {
    929929                if ( FCKBrowserInfo.IsIE )
    930                         return element.currentStyle[attrName] ;
     930                        return element.currentStyle[ propertyName ] ;
    931931                else
    932                         return w.getComputedStyle( element, '' )[attrName] ;
     932                        return element.ownerDocument.defaultView.getComputedStyle( element, '' ).getPropertyValue( propertyName ) ;
    933933        },
    934934
    935         GetPositionedAncestor : function( w, element )
     935        GetPositionedAncestor : function( element )
    936936        {
    937937                var currentElement = element ;
    938938                while ( currentElement != FCKTools.GetElementDocument( currentElement ).documentElement )
    939939                {
    940                         if ( this.GetCurrentElementStyle( w, currentElement, 'position' ) != 'static' )
     940                        if ( this.GetCurrentElementStyle( currentElement, 'position' ) != 'static' )
    941941                                return currentElement ;
    942942                        currentElement = currentElement.parentNode ;
    943943                }
     
    966966                        // Consider the margin in the scroll, which is ok for our current
    967967                        // needs, but needs investigation if we will be using this function
    968968                        // in other places.
    969                         offset += parseInt( this.GetCurrentElementStyle( window, element, 'marginBottom' ) || 0, 10 ) ;
     969                        offset += parseInt( this.GetCurrentElementStyle( element, 'marginBottom' ) || 0, 10 ) ;
    970970                }
    971971
    972972                // Appends the offsets for the entire element hierarchy.
  • editor/_source/internals/fcktools.js

     
    462462        // 1. It matters if document.body itself is a positioned element;
    463463        // 2. It matters is when we're in IE and the element has no positioned ancestor.
    464464        // Otherwise the values should be ignored.
    465         if ( FCKDomTools.GetCurrentElementStyle( w, w.document.body, 'position') != 'static'
    466                         || ( FCKBrowserInfo.IsIE && FCKDomTools.GetPositionedAncestor( w, node ) == null ) )
     465        if ( FCKDomTools.GetCurrentElementStyle( w.document.body, 'position') != 'static'
     466                        || ( FCKBrowserInfo.IsIE && FCKDomTools.GetPositionedAncestor( node ) == null ) )
    467467        {
    468468                x += w.document.body.offsetLeft ;
    469469                y += w.document.body.offsetTop ;
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy