Ticket #1982: 1982.patch
File 1982.patch, 3.2 KB (added by , 15 years ago) |
---|
-
_whatsnew.html
50 50 character inside text wasn't encoded in Opera and Safari.</li> 51 51 <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2467">#2467</a>] Fixed JavaScript 52 52 error with the fit window command in source mode.</li> 53 <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1982">#1982</a>] Submenus in IE7 54 now are shown properly.</li> 53 55 </ul> 54 56 <p> 55 57 <a href="_whatsnew_history.html">See previous versions history</a></p> -
editor/_source/classes/fckpanel.js
130 130 this._Popup.show( x, y, 0, 0, relElement ) ; 131 131 } 132 132 133 // Workaround for IE7 problem. See #1982 134 // Submenus are restricted to the size of its parent, so we increase it as needed. 135 FCKPanel.prototype.ResizeForSubpanel = function( panel, width, height ) 136 { 137 if ( !FCKBrowserInfo.IsIE7 ) 138 return ; 139 140 if ( !this._Popup.isOpen ) 141 { 142 this.Subpanel = null ; 143 return ; 144 } 145 146 // If we are resetting the extra space 147 if ( width == 0 && height == 0 ) 148 { 149 // Another subpanel is being shown, so we must not shrink back 150 if (this.Subpanel !== panel) 151 return ; 152 153 // Reset values. 154 // We leave the IncreasedY untouched to avoid vertical movement of the 155 // menu if the submenu is higher than the main menu. 156 this.Subpanel = null ; 157 this.IncreasedX = 0 ; 158 } 159 else 160 { 161 this.Subpanel = panel ; 162 // If the panel has already been increased enough, get out 163 if (( this.IncreasedX >= width) && (this.IncreasedY >= height)) 164 return ; 165 166 this.IncreasedX = Math.max(this.IncreasedX, width) ; 167 this.IncreasedY = Math.max(this.IncreasedY, height) ; 168 } 169 170 // Horizontally increase as needed (sum of widths). 171 // Vertically, use only the maximum of this menu or the submenu 172 this._Popup.show( this.ShowRect.x, this.ShowRect.y, this.ShowRect.w + this.IncreasedX, Math.max(this.ShowRect.h, this.IncreasedY) ) ; 173 } 174 133 175 FCKPanel.prototype.Show = function( x, y, relElement, width, height ) 134 176 { 135 177 var iMainWidth ; … … 160 202 x = ( x * -1 ) + relElement.offsetWidth - iMainWidth ; 161 203 } 162 204 205 if ( FCKBrowserInfo.IsIE7 ) 206 { 207 if (this.ParentPanel) 208 this.ParentPanel.ResizeForSubpanel(this, iMainWidth, eMainNode.offsetHeight) 209 210 // Store the values that will be used by the ResizeForSubpanel function 211 this.ShowRect = {x:x, y:y, w:iMainWidth, h:eMainNode.offsetHeight} ; 212 this.IncreasedX = 0 ; 213 this.IncreasedY = 0 ; 214 } 215 163 216 // Second call: Show the Popup at the specified location, with the correct size. 164 217 this._Popup.show( x, y, iMainWidth, eMainNode.offsetHeight, relElement ) ; 165 218 … … 375 428 window.clearInterval( this._Timer ) ; 376 429 this._Timer = null ; 377 430 431 if (this._Popup && this.ParentPanel && !forceHide) 432 this.ParentPanel.ResizeForSubpanel(this, 0, 0) 433 378 434 FCKTools.RunFunction( this.OnHide, this ) ; 379 435 } 380 436 }