Ticket #5915: 5915_10.patch

File 5915_10.patch, 2.1 KB (added by Tobiasz Cudnik, 13 years ago)
  • _source/plugins/dialog/plugin.js

     
    188188                                definition : definition
    189189                        }
    190190                        , editor ).definition;
     191
     192                var tabsToRemove = {};
     193                // Cache tabs that should be removed.
     194                if ( !( 'removeDialogContents' in editor._ ) && editor.config.removeDialogContents )
     195                {
     196                        var removeContents = editor.config.removeDialogContents.split(';');
     197
     198                        for ( i = 0; i < removeContents.length; i++ )
     199                        {
     200                                var parts = removeContents[ i ].split(':');
     201                                if ( parts.length == 2 )
     202                                {
     203                                        var dialogName = parts[ 0 ].toLowerCase();
     204                                        if ( !tabsToRemove[ dialogName ] )
     205                                                tabsToRemove[ dialogName ] = [];
     206                                        tabsToRemove[ dialogName ].push( parts[ 1 ].toLowerCase() );
     207                                }
     208                        }
     209                        editor._.removeDialogContents = tabsToRemove;
     210                }
     211
     212                // Remove tabs of this dialog.
     213                if ( editor._.removeDialogContents && ( tabsToRemove = editor._.removeDialogContents[ dialogName ] ) )
     214                {
     215                        for ( i = 0; i < tabsToRemove.length; i++ )
     216                                definition.removeContents( tabsToRemove[ i ] );
     217                }
     218
    191219                // Initialize load, show, hide, ok and cancel events.
    192220                if ( definition.onLoad )
    193221                        this.on( 'load', definition.onLoad );
     
    30103038 * @since 3.5
    30113039 * @example
    30123040 * config.dialog_buttonsOrder = 'rtl';
    3013 */
     3041 */
    30143042
    3015 /**
     3043/** 
     3044 * The dialog contents to removed. It's a string composed by dialog name and tab name with a colon between them.
     3045 * Separate each pair with semicolon (see example).
     3046 * <p>Note that the tab names and dialog names are case sensitive!</p>
     3047 * <b>Note: Be cautious when specifying dialog tabs that are mandatory, like "info", dialog functionality might be broken because of this!<b>
     3048 * @name CKEDITOR.config.removeDialogContents
     3049 * @type String
     3050 * @since 3.5
     3051 * @default ''
     3052 * @example
     3053 * config.removeDialogContents = 'flash:advanced;image:Link';
     3054 */
     3055
     3056/**
    30163057 * Fired when a dialog definition is about to be used to create a dialog into
    30173058 * an editor instance. This event makes it possible to customize the definition
    30183059 * before creating it.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy