Changeset 1130
- Timestamp:
- 2007-11-28 09:39:56 (2 years ago)
- Location:
- FCKeditor/trunk/editor/_source
- Files:
-
- 2 modified
-
classes/fckpanel.js (modified) (7 diffs)
-
internals/fck.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
FCKeditor/trunk/editor/_source/classes/fckpanel.js
r1129 r1130 27 27 this.IsRTL = ( FCKLang.Dir == 'rtl' ) ; 28 28 this.IsContextMenu = false ; 29 this.PanelListId = parseInt(Math.random() * 0x100000000);30 this.ShowTimestamp = 0 ;31 29 this._LockCounter = 0 ; 32 30 … … 127 125 var iMainWidth ; 128 126 var eMainNode = this.MainNode ; 129 FCK.ToolbarSet.CurrentInstance.OpenedPanels[this.PanelListId] = this ;130 this.ShowTimestamp = (new Date()).getTime() ;131 127 132 128 if ( this._Popup ) … … 169 165 { 170 166 // Be sure we'll not have more than one Panel opened at the same time. 171 /*172 167 if ( FCKPanel._OpenedPanel ) 173 168 FCKPanel._OpenedPanel.Hide() ; 174 */175 169 176 170 // Do not fire OnBlur while the panel is opened. … … 263 257 this._IFrame.contentWindow.focus() ; 264 258 265 //FCKPanel._OpenedPanel = this ;259 FCKPanel._OpenedPanel = this ; 266 260 } 267 261 … … 296 290 FCKTools.RunFunction( this.OnHide, this ) ; 297 291 } 298 299 delete FCK.ToolbarSet.CurrentInstance.OpenedPanels[this.PanelListId] ;300 292 } 301 293 … … 344 336 } 345 337 346 function FCKPanel_Global_OnClick( e, panelList )347 {348 var currentTimestamp = (new Date()).getTime() ;349 for ( var i in panelList )350 {351 // The timestamp check is needed because of a possible race condition,352 // in which the global onclick handler is called right after FCKPanel.Show().353 if ( panelList[i].ShowTimestamp < currentTimestamp - 100 )354 FCKPanel_Window_OnBlur( e, panelList[i] ) ;355 }356 }357 358 FCKPanel_Global_OnBlur = FCKPanel_Global_OnClick ;359 360 338 function CheckPopupOnHide( forceHide ) 361 339 { … … 375 353 this.Document = null ; 376 354 this.MainNode = null ; 377 delete FCK.ToolbarSet.CurrentInstance.OpenedPanels[this.PanelListId] ; 378 } 355 } -
FCKeditor/trunk/editor/_source/internals/fck.js
r1129 r1130 31 31 Toolbar : null, 32 32 HasFocus : false, 33 DataProcessor : new FCKDataProcessor(), 34 OpenedPanels : {}, 33 DataProcessor : new FCKDataProcessor(), 35 34 36 35 AttachToOnSelectionChange : function( functionPointer ) … … 883 882 FCKCommands.GetCommand( 'ShowBlocks' ).RestoreState() ; 884 883 885 FCKTools.AddEventListenerEx( FCK.EditorDocument, 'click', FCKPanel_Global_OnClick, FCK.ToolbarSet.CurrentInstance.OpenedPanels ) ;886 FCKTools.AddEventListenerEx( FCK.EditorDocument, 'blur', FCKPanel_Global_OnBlur, FCK.ToolbarSet.CurrentInstance.OpenedPanels ) ;887 888 884 // Check if it is not a startup call, otherwise complete the startup. 889 885 if ( FCK.Status != FCK_STATUS_NOTLOADED ) … … 892 888 if ( FCKConfig.Debug ) 893 889 FCKDebug._GetWindow() ; 894 895 FCKTools.AddEventListenerEx( document, 'click', FCKPanel_Global_OnClick, FCK.ToolbarSet.CurrentInstance.OpenedPanels );896 FCKTools.AddEventListenerEx( document, 'blur', FCKPanel_Global_OnBlur, FCK.ToolbarSet.CurrentInstance.OpenedPanels ) ;897 890 898 891 FCK.SetStatus( FCK_STATUS_ACTIVE ) ;