Changeset 1384

Show
Ignore:
Timestamp:
2008-01-22 16:08:28 (6 months ago)
Author:
fredck
Message:

Fixed #1769 : Improvements to FCKDomTools.GetCurrentElementStyle

Location:
FCKeditor/trunk/editor/_source
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • FCKeditor/trunk/editor/_source/classes/fckpanel.js

    r1192 r1384  
    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                { 
  • FCKeditor/trunk/editor/_source/internals/fckdomtools.js

    r1282 r1384  
    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] ; 
    933         }, 
    934  
    935         GetPositionedAncestor : function( w, element ) 
     932                        return element.ownerDocument.defaultView.getComputedStyle( element, '' ).getPropertyValue( propertyName ) ; 
     933        }, 
     934 
     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 ; 
     
    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 
     
    984984 
    985985 
     986 
  • FCKeditor/trunk/editor/_source/internals/fcktools.js

    r1107 r1384  
    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 ;