Changeset 1129
- Timestamp:
- 2007-11-28 08:40:02 (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
r1111 r1129 27 27 this.IsRTL = ( FCKLang.Dir == 'rtl' ) ; 28 28 this.IsContextMenu = false ; 29 this.PanelListId = parseInt(Math.random() * 0x100000000); 30 this.ShowTimestamp = 0 ; 29 31 this._LockCounter = 0 ; 30 32 … … 125 127 var iMainWidth ; 126 128 var eMainNode = this.MainNode ; 129 FCK.ToolbarSet.CurrentInstance.OpenedPanels[this.PanelListId] = this ; 130 this.ShowTimestamp = (new Date()).getTime() ; 127 131 128 132 if ( this._Popup ) … … 165 169 { 166 170 // Be sure we'll not have more than one Panel opened at the same time. 171 /* 167 172 if ( FCKPanel._OpenedPanel ) 168 173 FCKPanel._OpenedPanel.Hide() ; 174 */ 169 175 170 176 // Do not fire OnBlur while the panel is opened. … … 257 263 this._IFrame.contentWindow.focus() ; 258 264 259 FCKPanel._OpenedPanel = this ;265 //FCKPanel._OpenedPanel = this ; 260 266 } 261 267 … … 290 296 FCKTools.RunFunction( this.OnHide, this ) ; 291 297 } 298 299 delete FCK.ToolbarSet.CurrentInstance.OpenedPanels[this.PanelListId] ; 292 300 } 293 301 … … 336 344 } 337 345 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 338 360 function CheckPopupOnHide( forceHide ) 339 361 { … … 353 375 this.Document = null ; 354 376 this.MainNode = null ; 355 } 377 delete FCK.ToolbarSet.CurrentInstance.OpenedPanels[this.PanelListId] ; 378 } -
FCKeditor/trunk/editor/_source/internals/fck.js
r1123 r1129 31 31 Toolbar : null, 32 32 HasFocus : false, 33 DataProcessor : new FCKDataProcessor(), 33 DataProcessor : new FCKDataProcessor(), 34 OpenedPanels : {}, 34 35 35 36 AttachToOnSelectionChange : function( functionPointer ) … … 882 883 FCKCommands.GetCommand( 'ShowBlocks' ).RestoreState() ; 883 884 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 884 888 // Check if it is not a startup call, otherwise complete the startup. 885 889 if ( FCK.Status != FCK_STATUS_NOTLOADED ) … … 888 892 if ( FCKConfig.Debug ) 889 893 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 ) ; 890 897 891 898 FCK.SetStatus( FCK_STATUS_ACTIVE ) ;