Ticket #5915: 5915_8.patch

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

     
    179179                                definition : definition
    180180                        }
    181181                        , editor ).definition;
     182
     183                //cache tabs to remove read from config
     184                if( editor._.removeDialogContents === undefined )
     185                {
     186                        if( editor.config.removeDialogContents )
     187                        {
     188                                editor._.removeDialogContents = editor.config.removeDialogContents.split( ";" );
     189
     190                                var tabsToRemove = new Array();
     191
     192                                for ( var i = 0, len = editor._.removeDialogContents.length ; i < len ; i++ )
     193                                {
     194                                        if ( editor._.removeDialogContents[ i ].indexOf( ":" ) != -1 )
     195                                        {
     196                                                var dialogContent = editor._.removeDialogContents[i].split( ":" );
     197
     198                                                tabsToRemove.push( { dialogName: dialogContent[ 0 ], tabName: dialogContent[ 1 ] });
     199                                        }
     200                                }
     201                                editor._.removeDialogContents = tabsToRemove;
     202                        }
     203                        else
     204                        {
     205                                editor._.removeDialogContents = null;
     206                        }
     207                }
     208
     209                // check if there is any tabs to remove
     210                if ( editor._.removeDialogContents )
     211                {
     212                        for ( var i = 0, len = editor._.removeDialogContents.length ; i < len ; i++ )
     213                        {
     214                                if ( dialogName == editor._.removeDialogContents[ i ].dialogName )
     215                                        definition.removeContents( editor._.removeDialogContents[ i ].tabName );
     216                        }
     217                }
     218
    182219                // Initialize load, show, hide, ok and cancel events.
    183220                if ( definition.onLoad )
    184221                        this.on( 'load', definition.onLoad );
     
    30133050 * @param String page The id of the page that it's gonna be selected.
    30143051 * @param String currentPage The id of the current page.
    30153052 */
     3053
     3054/**
     3055 * <p>Note: be cautious when specifying dialog tabs that are mandatory, like "info", dialog functionality might be broken because of this </p>
     3056 * The dialog contents to remove.
     3057 * @name CKEDITOR.config.removeDialogContents
     3058 * @type String
     3059 * @since 3.5
     3060 * @default ''
     3061 * @example
     3062 * config.removeDialogContents = 'flash:advanced;image:advanced';
     3063 */
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy