Ticket #5755: 5755_2.patch

File 5755_2.patch, 2.3 KB (added by Sa'ar Zac Elias, 12 years ago)
  • _source/plugins/dialog/plugin.js

     
    104104        CKEDITOR.dialog = function( editor, dialogName )
    105105        {
    106106                // Load the dialog definition.
    107                 var definition = CKEDITOR.dialog._.dialogDefinitions[ dialogName ];
     107                var definition = CKEDITOR.dialog._.dialogDefinitions[ dialogName ],
     108                        defaultDefinition = CKEDITOR.tools.clone( defaultDialogDefinition ),
     109                        buttonsOrder = editor.config.dialog_buttonsOrder || 'OS',
     110                        dir = editor.lang.dir;
    108111
     112                if ( ( buttonsOrder == 'OS' && CKEDITOR.env.mac ) ||    // The buttons in MacOS Apps are in reverse order (#4750)
     113                        ( buttonsOrder == 'rtl' || buttonsOrder == 'OS' && dir == 'rtl' ) ) // The buttons in RTL should be located in the reverse order
     114                                defaultDefinition.buttons.reverse();
     115
    109116                // Completes the definition with the default values.
    110                 definition = CKEDITOR.tools.extend( definition( editor ), defaultDialogDefinition );
     117                definition = CKEDITOR.tools.extend( definition( editor ), defaultDefinition );
    111118
    112119                // Clone a functionally independent copy for this dialog.
    113120                definition = CKEDITOR.tools.clone( definition );
     
    13441351                buttons : [ CKEDITOR.dialog.okButton, CKEDITOR.dialog.cancelButton ]
    13451352        };
    13461353
    1347         // The buttons in MacOS Apps are in reverse order #4750
    1348         CKEDITOR.env.mac && defaultDialogDefinition.buttons.reverse();
    1349 
    13501354        // Tool function used to return an item from an array based on its id
    13511355        // property.
    13521356        var getById = function( array, id, recurse )
     
    29932997 */
    29942998
    29952999/**
     3000 * The guildeline to follow when generating the dialog buttons. There are 3 possible options:
     3001 * <ul>
     3002 *     <li>'OS' - the buttons will be displayed in the default order of the user's OS;</li>
     3003 *     <li>'ltr' - for Left-To-Right order;</li>
     3004 *     <li>'rtl' - for Right-To-Left order.</li>
     3005 * </ul>
     3006 * @name CKEDITOR.config.dialog_buttonsOrder
     3007 * @type String
     3008 * @default 'OS'
     3009 * @since 3.5
     3010 * @example
     3011 * config.dialog_buttonsOrder = 'rtl';
     3012 */
     3013
     3014/**
    29963015 * Fired when a dialog definition is about to be used to create a dialog into
    29973016 * an editor instance. This event makes it possible to customize the definition
    29983017 * before creating it.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy