Changeset 1129


Ignore:
Timestamp:
11/28/07 08:40:02 (6 years ago)
Author:
martinkou
Message:

Fixed #1583 : Fixed the issue where opening submenus would close their parent menus after [1111].
Fixed #1559 : Fixed the issue where it is possible for two or more unrelated menus to appear simultaneously in FF3 beta.

Location:
FCKeditor/trunk/editor/_source
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • FCKeditor/trunk/editor/_source/classes/fckpanel.js

    r1111 r1129  
    2727        this.IsRTL                      = ( FCKLang.Dir == 'rtl' ) ; 
    2828        this.IsContextMenu      = false ; 
     29        this.PanelListId        = parseInt(Math.random() * 0x100000000); 
     30        this.ShowTimestamp      = 0 ; 
    2931        this._LockCounter       = 0 ; 
    3032 
     
    125127        var iMainWidth ; 
    126128        var eMainNode = this.MainNode ; 
     129        FCK.ToolbarSet.CurrentInstance.OpenedPanels[this.PanelListId] = this ; 
     130        this.ShowTimestamp = (new Date()).getTime() ; 
    127131 
    128132        if ( this._Popup ) 
     
    165169        { 
    166170                // Be sure we'll not have more than one Panel opened at the same time. 
     171                /* 
    167172                if ( FCKPanel._OpenedPanel ) 
    168173                        FCKPanel._OpenedPanel.Hide() ; 
     174                */ 
    169175 
    170176                // Do not fire OnBlur while the panel is opened. 
     
    257263                this._IFrame.contentWindow.focus() ; 
    258264 
    259                 FCKPanel._OpenedPanel = this ; 
     265                //FCKPanel._OpenedPanel = this ; 
    260266        } 
    261267 
     
    290296                        FCKTools.RunFunction( this.OnHide, this ) ; 
    291297        } 
     298 
     299        delete FCK.ToolbarSet.CurrentInstance.OpenedPanels[this.PanelListId] ; 
    292300} 
    293301 
     
    336344} 
    337345 
     346function 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 
     358FCKPanel_Global_OnBlur = FCKPanel_Global_OnClick ; 
     359 
    338360function CheckPopupOnHide( forceHide ) 
    339361{ 
     
    353375        this.Document = null ; 
    354376        this.MainNode = null ; 
    355 } 
     377        delete FCK.ToolbarSet.CurrentInstance.OpenedPanels[this.PanelListId] ; 
     378} 
  • FCKeditor/trunk/editor/_source/internals/fck.js

    r1123 r1129  
    3131        Toolbar                 : null, 
    3232        HasFocus                : false, 
    33         DataProcessor   : new FCKDataProcessor(), 
     33        DataProcessor           : new FCKDataProcessor(), 
     34        OpenedPanels            : {}, 
    3435 
    3536        AttachToOnSelectionChange : function( functionPointer ) 
     
    882883        FCKCommands.GetCommand( 'ShowBlocks' ).RestoreState() ; 
    883884 
     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 
    884888        // Check if it is not a startup call, otherwise complete the startup. 
    885889        if ( FCK.Status != FCK_STATUS_NOTLOADED ) 
     
    888892        if ( FCKConfig.Debug ) 
    889893                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 ) ; 
    890897 
    891898        FCK.SetStatus( FCK_STATUS_ACTIVE ) ; 
Note: See TracChangeset for help on using the changeset viewer.
© 2003 – 2012 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy