Index: /FCKeditor/trunk/_whatsnew.html =================================================================== --- /FCKeditor/trunk/_whatsnew.html (revision 2385) +++ /FCKeditor/trunk/_whatsnew.html (revision 2386) @@ -59,4 +59,6 @@ placed inside a container with dimensions or floating it wasn't possible to edit its properties from the toolbar or context menu. +
Index: /FCKeditor/trunk/editor/_source/classes/fckpanel.js =================================================================== --- /FCKeditor/trunk/editor/_source/classes/fckpanel.js (revision 2385) +++ /FCKeditor/trunk/editor/_source/classes/fckpanel.js (revision 2386) @@ -131,4 +131,54 @@ } +// Workaround for IE7 problem. See #1982 +// Submenus are restricted to the size of its parent, so we increase it as needed. +// Returns true if the panel has been repositioned +FCKPanel.prototype.ResizeForSubpanel = function( panel, width, height ) +{ + if ( !FCKBrowserInfo.IsIE7 ) + return false ; + + if ( !this._Popup.isOpen ) + { + this.Subpanel = null ; + return false ; + } + + // If we are resetting the extra space + if ( width == 0 && height == 0 ) + { + // Another subpanel is being shown, so we must not shrink back + if (this.Subpanel !== panel) + return false ; + + // Reset values. + // We leave the IncreasedY untouched to avoid vertical movement of the + // menu if the submenu is higher than the main menu. + this.Subpanel = null ; + this.IncreasedX = 0 ; + } + else + { + this.Subpanel = panel ; + // If the panel has already been increased enough, get out + if (( this.IncreasedX >= width) && (this.IncreasedY >= height)) + return false ; + + this.IncreasedX = Math.max(this.IncreasedX, width) ; + this.IncreasedY = Math.max(this.IncreasedY, height) ; + } + + var x = this.ShowRect.x ; + var w = this.IncreasedX ; + if ( this.IsRTL ) + x = x - w ; + + // Horizontally increase as needed (sum of widths). + // Vertically, use only the maximum of this menu or the submenu + this._Popup.show( x, this.ShowRect.y, this.ShowRect.w + w, Math.max(this.ShowRect.h, this.IncreasedY) ) ; + + return this.IsRTL ; +} + FCKPanel.prototype.Show = function( x, y, relElement, width, height ) { @@ -153,4 +203,14 @@ iMainWidth = eMainNode.offsetWidth ; + if ( FCKBrowserInfo.IsIE7 ) + { + if (this.ParentPanel && this.ParentPanel.ResizeForSubpanel(this, iMainWidth, eMainNode.offsetHeight) ) + { + // As the parent has moved, allow the browser to update its internal data, so the new position is correct. + FCKTools.RunFunction( this.Show, this, [x, y, relElement] ) ; + return ; + } + } + if ( this.IsRTL ) { @@ -159,4 +219,12 @@ else if ( relElement ) x = ( x * -1 ) + relElement.offsetWidth - iMainWidth ; + } + + if ( FCKBrowserInfo.IsIE7 ) + { + // Store the values that will be used by the ResizeForSubpanel function + this.ShowRect = {x:x, y:y, w:iMainWidth, h:eMainNode.offsetHeight} ; + this.IncreasedX = 0 ; + this.IncreasedY = 0 ; } @@ -376,4 +444,7 @@ this._Timer = null ; + if (this._Popup && this.ParentPanel && !forceHide) + this.ParentPanel.ResizeForSubpanel(this, 0, 0) + FCKTools.RunFunction( this.OnHide, this ) ; }