Ticket #1514: 1514.patch
File 1514.patch, 6.7 KB (added by , 15 years ago) |
---|
-
editor/_source/internals/fck.js
32 32 HasFocus : false, 33 33 DataProcessor : new FCKDataProcessor(), 34 34 35 GetInstanceObject : (function() 36 { 37 var w = window ; 38 return function( name ) 39 { 40 return w[name] ; 41 } 42 })(), 43 35 44 AttachToOnSelectionChange : function( functionPointer ) 36 45 { 37 46 this.Events.AttachEvent( 'OnSelectionChange', functionPointer ) ; -
editor/_source/internals/fcktoolbarset.js
107 107 } 108 108 109 109 oToolbarSet.CurrentInstance = FCK ; 110 if ( !oToolbarSet.ToolbarItems ) 111 oToolbarSet.ToolbarItems = FCKToolbarItems ; 110 112 111 113 FCK.AttachToOnSelectionChange( oToolbarSet.RefreshItemsState ) ; 112 114 -
editor/_source/commandclasses/fcktextcolorcommand.js
42 42 this._Panel.AppendStyleSheet( FCKConfig.SkinPath + 'fck_editor.css' ) ; 43 43 this._Panel.MainNode.className = 'FCK_Panel' ; 44 44 this._CreatePanelBody( this._Panel.Document, this._Panel.MainNode ) ; 45 FCK.ToolbarSet.ToolbarItems.GetItem( this.Name ).RegisterPanel( this._Panel ) ; 45 46 46 47 FCKTools.DisableSelection( this._Panel.Document.body ) ; 47 48 } -
editor/_source/classes/fcktoolbarpanelbutton.js
48 48 this._UIButton.Create( parentElement ) ; 49 49 50 50 var oPanel = FCK.ToolbarSet.CurrentInstance.Commands.GetCommand( this.CommandName )._Panel ; 51 this.RegisterPanel( oPanel ) ; 52 } 53 54 FCKToolbarPanelButton.prototype.RegisterPanel = function( oPanel ) 55 { 56 if ( oPanel._FCKToolbarPanelButton ) 57 return ; 58 51 59 oPanel._FCKToolbarPanelButton = this ; 52 60 53 61 var eLineDiv = oPanel.Document.body.appendChild( oPanel.Document.createElement( 'div' ) ) ; 54 62 eLineDiv.style.position = 'absolute' ; 55 63 eLineDiv.style.top = '0px' ; 56 64 57 var eLine = this.LineImg= eLineDiv.appendChild( oPanel.Document.createElement( 'IMG' ) ) ;65 var eLine = oPanel._FCKToolbarPanelButtonLineDiv = eLineDiv.appendChild( oPanel.Document.createElement( 'IMG' ) ) ; 58 66 eLine.className = 'TB_ConnectionLine' ; 59 67 eLine.style.position = 'absolute' ; 60 68 // eLine.style.backgroundColor = 'Red' ; … … 74 82 75 83 oButton._UIButton.ChangeState( FCK_TRISTATE_ON ) ; 76 84 77 oButton.LineImg.style.width = ( e.offsetWidth - 2 ) + 'px' ;85 // oButton.LineImg.style.width = ( e.offsetWidth - 2 ) + 'px' ; 78 86 79 FCK.ToolbarSet.CurrentInstance.Commands.GetCommand( oButton.CommandName ).Execute( 0, e.offsetHeight - 1, e ) ; // -1 to be over the border 87 var oCommand = FCK.ToolbarSet.CurrentInstance.Commands.GetCommand( oButton.CommandName ) ; 88 var oPanel = oCommand._Panel ; 89 oPanel._FCKToolbarPanelButtonLineDiv.style.width = ( e.offsetWidth - 2 ) + 'px' ; 90 oCommand.Execute( 0, e.offsetHeight - 1, e ) ; // -1 to be over the border 80 91 } 81 92 82 93 function FCKToolbarPanelButton_OnPanelHide() -
editor/_source/classes/fckpanel.js
64 64 zIndex : FCKConfig.FloatingPanelsZIndex 65 65 } ) ; 66 66 67 if ( this._Window == window.parent && window.frameElement ) 68 { 69 var scrollPos = null ; 70 if ( FCKBrowserInfo.IsGecko && FCK && FCK.EditorDocument ) 71 scrollPos = [ FCK.EditorDocument.body.scrollLeft, FCK.EditorDocument.body.scrollTop ] ; 72 window.frameElement.parentNode.insertBefore( oIFrame, window.frameElement ) ; 73 if ( scrollPos ) 74 { 75 var restoreFunc = function() 76 { 77 FCK.EditorDocument.body.scrollLeft = scrollPos[0] ; 78 FCK.EditorDocument.body.scrollTop = scrollPos[1] ; 79 } 80 setTimeout( restoreFunc, 500 ) ; 81 } 82 } 83 else 84 this._Window.document.body.appendChild( oIFrame ) ; 67 this._Window.document.body.appendChild( oIFrame ) ; 85 68 86 69 var oIFrameWindow = oIFrame.contentWindow ; 87 70 … … 187 170 } 188 171 189 172 // Be sure we'll not have more than one Panel opened at the same time. 190 if ( FCKPanel._OpenedPanel ) 191 FCKPanel._OpenedPanel.Hide() ; 173 // Do not unlock focus manager here because we're displaying another floating panel 174 // instead of returning the editor to a "no panel" state (Bug #1514). 175 if ( FCK.ToolbarSet.CurrentInstance.GetInstanceObject( 'FCKPanel' )._OpenedPanel && 176 FCK.ToolbarSet.CurrentInstance.GetInstanceObject( 'FCKPanel' )._OpenedPanel != this ) 177 FCK.ToolbarSet.CurrentInstance.GetInstanceObject( 'FCKPanel' )._OpenedPanel.Hide( false, true ) ; 192 178 193 179 FCKDomTools.SetElementStyles( eMainNode, 194 180 { … … 253 239 y -= y + eMainNode.offsetHeight - iViewPaneHeight ; 254 240 } 255 241 256 if ( x < 0 )257 x = 0 ;258 259 242 // Set the context menu DIV in the specified location. 260 243 FCKDomTools.SetElementStyles( this._IFrame, 261 244 { … … 263 246 top : y + 'px' 264 247 } ) ; 265 248 266 var iWidth = iMainWidth ; 267 var iHeight = eMainNode.offsetHeight ; 249 var me = this ; 250 var resizeFunc = function() 251 { 252 var iWidth = eMainNode.offsetWidth || eMainNode.firstChild.offsetWidth ; 253 var iHeight = eMainNode.offsetHeight ; 254 me._IFrame.width = iWidth ; 255 me._IFrame.height = iHeight ; 256 } 257 setTimeout( resizeFunc, 1 ) ; 268 258 269 this._IFrame.width = iWidth ;270 this._IFrame.height = iHeight ;271 272 259 // Move the focus to the IFRAME so we catch the "onblur". 273 260 this._IFrame.contentWindow.focus() ; 274 261 275 FCK Panel._OpenedPanel = this ;262 FCK.ToolbarSet.CurrentInstance.GetInstanceObject( 'FCKPanel' )._OpenedPanel = this ; 276 263 } 277 264 278 265 this._IsOpened = true ; … … 280 267 FCKTools.RunFunction( this.OnShow, this ) ; 281 268 } 282 269 283 FCKPanel.prototype.Hide = function( ignoreOnHide )270 FCKPanel.prototype.Hide = function( ignoreOnHide, ignoreFocusManagerUnlock ) 284 271 { 285 272 if ( this._Popup ) 286 273 this._Popup.hide() ; … … 290 277 return ; 291 278 292 279 // Enable the editor to fire the "OnBlur". 293 if ( typeof( FCKFocusManager ) != 'undefined' )280 if ( typeof( FCKFocusManager ) != 'undefined' && !ignoreFocusManagerUnlock ) 294 281 FCKFocusManager.Unlock() ; 295 282 296 283 // It is better to set the sizes to 0, otherwise Firefox would have