Ticket #3804: 3804_2.patch

File 3804_2.patch, 2.4 KB (added by Martin Kou, 15 years ago)
  • _source/plugins/floatpanel/plugin.js

     
    112112                                        position = offsetParent.getDocumentPosition( element.getDocument() ),
    113113                                        rtl = this._.dir == 'rtl';
    114114
     115                                if ( window.console ) console.log( 'x=', position.x, ', y=', position.y );
     116
    115117                                var left        = position.x + ( offsetX || 0 ),
    116118                                        top             = position.y + ( offsetY || 0 );
    117119
  • _source/core/dom/element.js

     
    10991099                getDocumentPosition : function( refDocument )
    11001100                {
    11011101                        var x = 0, y = 0,
    1102                                 body = this.getDocument().getBody();
     1102                                body = this.getDocument().getBody(),
     1103                                quirks = this.getDocument().$.compatMode == 'BackCompat';
    11031104
    11041105                        if ( document.documentElement[ "getBoundingClientRect" ] )
    11051106                        {
    11061107                                var box  = this.$.getBoundingClientRect(),
    1107                                         doc = this.getDocument().$,
    1108                                         docElem = doc.documentElement,
    1109                                         clientTop = docElem.clientTop || body.$.clientTop || 0,
    1110                                         clientLeft = docElem.clientLeft || body.$.clientLeft || 0;
     1108                                        doc = this.getDocument(),
     1109                                        $doc = doc.$,
     1110                                        $docElem = $doc.documentElement,
     1111                                        inDocElem = doc.getDocumentElement().contains( this ),
     1112                                        inBody = doc.getBody().contains( this ),
     1113                                        clientTop = inDocElem && $docElem.clientTop || inBody && body.$.clientTop || 0,
     1114                                        clientLeft = inDocElem && $docElem.clientLeft || inBody && body.$.clientLeft || 0;
    11111115
    1112                                 x = box.left + ( !CKEDITOR.env.quirks && docElem.scrollLeft || body.$.scrollLeft );
     1116                                x = box.left + ( !quirks && inDocElem && $docElem.scrollLeft || inBody && body.$.scrollLeft );
    11131117                                x -= clientLeft;
    1114                                 y = box.top  + ( !CKEDITOR.env.quirks && docElem.scrollTop || body.$.scrollTop );
     1118                                y = box.top  + ( !quirks && inDocElem && $docElem.scrollTop || inBody && body.$.scrollTop );
    11151119                                y -= clientTop;
    11161120                        }
    11171121                        else
     
    11611165                        {
    11621166                                // In Firefox, we'll endup one pixel before the element positions,
    11631167                                // so we must add it here.
    1164                                 if ( CKEDITOR.env.gecko && !CKEDITOR.env.quirks )
     1168                                if ( CKEDITOR.env.gecko && !quirks )
    11651169                                {
    11661170                                        x += this.$.clientLeft ? 1 : 0;
    11671171                                        y += this.$.clientTop ? 1 : 0;
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy