Ticket #4779: 4779.patch

File 4779.patch, 2.6 KB (added by Garry Yao, 13 years ago)
  • _source/plugins/resize/plugin.js

     
    99        {
    1010                var config = editor.config;
    1111
    12                 if ( config.resize_enabled )
     12                ( config.resize_maxWidth == undefined ) && ( config.resize_maxWidth = 3000 );
     13                ( config.resize_maxHeight == undefined ) && ( config.resize_maxHeight = 3000 );
     14
     15                if ( config.resize_enabled !== false )
    1316                {
    1417                        var container = null;
    1518                        var origin, startSize;
     
    4548                                        startSize = { width : container.$.offsetWidth || 0, height : container.$.offsetHeight || 0 };
    4649                                        origin = { x : $event.screenX, y : $event.screenY };
    4750
     51                                        ( config.resize_minWidth == undefined ) && ( config.resize_minWidth = Math.floor( .5 * startSize.width ) );
     52                                        ( config.resize_minHeight == undefined ) && ( config.resize_minHeight = Math.floor( .5 * startSize.height ) );
     53
    4854                                        CKEDITOR.document.on( 'mousemove', dragHandler );
    4955                                        CKEDITOR.document.on( 'mouseup', dragEndHandler );
    5056
     
    7379
    7480/**
    7581 * The minimum editor width, in pixels, when resizing it with the resize handle.
     82 * @name CKEDITOR.config.resize_minWidth
    7683 * @type Number
    77  * @default 750
     84 * @default 1/2 of the editor's start width size.
    7885 * @example
    7986 * config.resize_minWidth = 500;
    8087 */
    81 CKEDITOR.config.resize_minWidth = 750;
    8288
    8389/**
    8490 * The minimum editor height, in pixels, when resizing it with the resize handle.
     91 * @name CKEDITOR.config.resize_minHeight
    8592 * @type Number
    86  * @default 250
     93 * @default 1/2 of the editor's start height size.
    8794 * @example
    8895 * config.resize_minHeight = 600;
    8996 */
    90 CKEDITOR.config.resize_minHeight = 250;
    9197
    9298/**
    9399 * The maximum editor width, in pixels, when resizing it with the resize handle.
     100 * @name CKEDITOR.config.resize_maxWidth
    94101 * @type Number
    95102 * @default 3000
    96103 * @example
    97104 * config.resize_maxWidth = 750;
    98105 */
    99 CKEDITOR.config.resize_maxWidth = 3000;
    100106
    101107/**
    102108 * The maximum editor height, in pixels, when resizing it with the resize handle.
     109 * @name CKEDITOR.config.resize_maxHeight
    103110 * @type Number
    104111 * @default 3000
    105112 * @example
    106113 * config.resize_maxHeight = 600;
    107114 */
    108 CKEDITOR.config.resize_maxHeight = 3000;
    109115
    110116/**
    111117 * Whether to enable the resizing feature. If disabed the resize handler will not be visible.
     118 * @name CKEDITOR.config.resize_enabled
    112119 * @type Boolean
    113120 * @default true
    114121 * @example
    115122 * config.resize_enabled = false;
    116123 */
    117 CKEDITOR.config.resize_enabled = true;
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy