Ticket #1982: 1982_1.patch
File 1982_1.patch, 3.7 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 // Returns true if the panel has been repositioned 136 FCKPanel.prototype.ResizeForSubpanel = function( panel, width, height ) 137 { 138 if ( !FCKBrowserInfo.IsIE7 ) 139 return false ; 140 141 if ( !this._Popup.isOpen ) 142 { 143 this.Subpanel = null ; 144 return false ; 145 } 146 147 // If we are resetting the extra space 148 if ( width == 0 && height == 0 ) 149 { 150 // Another subpanel is being shown, so we must not shrink back 151 if (this.Subpanel !== panel) 152 return false ; 153 154 // Reset values. 155 // We leave the IncreasedY untouched to avoid vertical movement of the 156 // menu if the submenu is higher than the main menu. 157 this.Subpanel = null ; 158 this.IncreasedX = 0 ; 159 } 160 else 161 { 162 this.Subpanel = panel ; 163 // If the panel has already been increased enough, get out 164 if (( this.IncreasedX >= width) && (this.IncreasedY >= height)) 165 return false ; 166 167 this.IncreasedX = Math.max(this.IncreasedX, width) ; 168 this.IncreasedY = Math.max(this.IncreasedY, height) ; 169 } 170 171 var x = this.ShowRect.x ; 172 var w = this.IncreasedX ; 173 if ( this.IsRTL ) 174 x = x - w ; 175 176 // Horizontally increase as needed (sum of widths). 177 // 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) ) ; 179 180 return this.IsRTL ; 181 } 182 133 183 FCKPanel.prototype.Show = function( x, y, relElement, width, height ) 134 184 { 135 185 var iMainWidth ; … … 152 202 153 203 iMainWidth = eMainNode.offsetWidth ; 154 204 205 if ( FCKBrowserInfo.IsIE7 ) 206 { 207 if (this.ParentPanel && this.ParentPanel.ResizeForSubpanel(this, iMainWidth, eMainNode.offsetHeight) ) 208 { 209 // As the parent has moved, allow the browser to update its internal data, so the new position is correct. 210 FCKTools.RunFunction( this.Show, this, [x, y, relElement] ) ; 211 return ; 212 } 213 } 214 155 215 if ( this.IsRTL ) 156 216 { 157 217 if ( this.IsContextMenu ) … … 160 220 x = ( x * -1 ) + relElement.offsetWidth - iMainWidth ; 161 221 } 162 222 223 if ( FCKBrowserInfo.IsIE7 ) 224 { 225 // Store the values that will be used by the ResizeForSubpanel function 226 this.ShowRect = {x:x, y:y, w:iMainWidth, h:eMainNode.offsetHeight} ; 227 this.IncreasedX = 0 ; 228 this.IncreasedY = 0 ; 229 } 230 163 231 // Second call: Show the Popup at the specified location, with the correct size. 164 232 this._Popup.show( x, y, iMainWidth, eMainNode.offsetHeight, relElement ) ; 165 233 … … 375 443 window.clearInterval( this._Timer ) ; 376 444 this._Timer = null ; 377 445 446 if (this._Popup && this.ParentPanel && !forceHide) 447 this.ParentPanel.ResizeForSubpanel(this, 0, 0) 448 378 449 FCKTools.RunFunction( this.OnHide, this ) ; 379 450 } 380 451 }