Ticket #1982: 1982_3.patch

File 1982_3.patch, 1.7 KB (added by Martin Kou, 15 years ago)
  • editor/_source/classes/fckpanel.js

     
    161161        {
    162162                this.Subpanel = panel ;
    163163                // If the panel has already been increased enough, get out
    164                 if (( this.IncreasedX >= width) && (this.IncreasedY >= height))
     164                if ( ( this.IncreasedX >= width ) && ( this.IncreasedY >= height ) )
    165165                        return false ;
    166166
    167                 this.IncreasedX = Math.max(this.IncreasedX, width) ;
    168                 this.IncreasedY = Math.max(this.IncreasedY, height) ;
     167                this.IncreasedX = Math.max( this.IncreasedX, width ) ;
     168                this.IncreasedY = Math.max( this.IncreasedY, height ) ;
    169169        }
    170170
    171171        var x = this.ShowRect.x ;
     
    175175       
    176176        // Horizontally increase as needed (sum of widths).
    177177        // Vertically, use only the maximum of this menu or the submenu
    178         this._Popup.show( x, this.ShowRect.y, this.ShowRect.w + w, Math.max(this.ShowRect.h, this.IncreasedY) ) ;
     178        var finalWidth = this.ShowRect.w + w ;
     179        var finalHeight = Math.max( this.ShowRect.h, this.IncreasedY ) ;
     180        if ( this.ParentPanel )
     181                this.ParentPanel.ResizeForSubpanel( this, finalWidth, finalHeight ) ;
     182        this._Popup.show( x, this.ShowRect.y, finalWidth, finalHeight, this.RelativeElement ) ;
    179183
    180184        return this.IsRTL ;
    181185}
     
    226230                        this.ShowRect = {x:x, y:y, w:iMainWidth, h:eMainNode.offsetHeight} ;
    227231                        this.IncreasedX = 0 ;
    228232                        this.IncreasedY = 0 ;
     233                        this.RelativeElement = relElement ;
    229234                }
    230235
    231236                // Second call: Show the Popup at the specified location, with the correct size.
     
    456461        this._Window = null ;
    457462        this.Document = null ;
    458463        this.MainNode = null ;
     464        this.RelativeElement = null ;
    459465}
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy