Ticket #4779: 4779_2.patch

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

     
    99        {
    1010                var config = editor.config;
    1111
    12                 if ( config.resize_enabled )
     12                !config.resize_dir && ( config.resize_dir = 'both' );
     13                ( config.resize_maxWidth == undefined ) && ( config.resize_maxWidth = 3000 );
     14                ( config.resize_maxHeight == undefined ) && ( config.resize_maxHeight = 3000 );
     15                ( config.resize_minWidth == undefined ) && ( config.resize_minWidth = 750 );
     16                ( config.resize_minHeight == undefined ) && ( config.resize_minHeight = 250 );
     17
     18                if ( config.resize_enabled !== false )
    1319                {
    1420                        var container = null,
    1521                                origin,
     
    5763                                        startSize = { width : container.$.offsetWidth || 0, height : container.$.offsetHeight || 0 };
    5864                                        origin = { x : $event.screenX, y : $event.screenY };
    5965
     66                                        config.resize_minWidth > startSize.width && ( config.resize_minWidth = startSize.width );
     67                                        config.resize_minHeight > startSize.height && ( config.resize_minHeight = startSize.height );
     68
    6069                                        CKEDITOR.document.on( 'mousemove', dragHandler );
    6170                                        CKEDITOR.document.on( 'mouseup', dragEndHandler );
    6271
     
    91100
    92101/**
    93102 * The minimum editor width, in pixels, when resizing it with the resize handle.
     103 * Note: It fallbacks to editor's actual width if that's smaller than the default value.
     104 * @name CKEDITOR.config.resize_minWidth
    94105 * @type Number
    95106 * @default 750
    96107 * @example
    97108 * config.resize_minWidth = 500;
    98109 */
    99 CKEDITOR.config.resize_minWidth = 750;
    100110
    101111/**
    102112 * The minimum editor height, in pixels, when resizing it with the resize handle.
     113 * Note: It fallbacks to editor's actual height if that's smaller than the default value.
     114 * @name CKEDITOR.config.resize_minHeight
    103115 * @type Number
    104116 * @default 250
    105117 * @example
    106118 * config.resize_minHeight = 600;
    107119 */
    108 CKEDITOR.config.resize_minHeight = 250;
    109120
    110121/**
    111122 * The maximum editor width, in pixels, when resizing it with the resize handle.
     123 * @name CKEDITOR.config.resize_maxWidth
    112124 * @type Number
    113125 * @default 3000
    114126 * @example
    115127 * config.resize_maxWidth = 750;
    116128 */
    117 CKEDITOR.config.resize_maxWidth = 3000;
    118129
    119130/**
    120131 * The maximum editor height, in pixels, when resizing it with the resize handle.
     132 * @name CKEDITOR.config.resize_maxHeight
    121133 * @type Number
    122134 * @default 3000
    123135 * @example
    124136 * config.resize_maxHeight = 600;
    125137 */
    126 CKEDITOR.config.resize_maxHeight = 3000;
    127138
    128139/**
    129  * Whether to enable the resizing feature. If disabled the resize handler will not be visible.
     140 * Whether to enable the resizing feature. If disabed the resize handler will not be visible.
     141 * @name CKEDITOR.config.resize_enabled
    130142 * @type Boolean
    131143 * @default true
    132144 * @example
    133145 * config.resize_enabled = false;
    134146 */
    135 CKEDITOR.config.resize_enabled = true;
    136 
    137 /**
    138  * The directions to which the editor resizing is enabled. Possible values
    139  * are "both", "vertical" and "horizontal".
    140  * @type String
    141  * @default 'both'
    142  * @since 3.3
    143  * @example
    144  * config.resize_dir = 'vertical';
    145  */
    146 CKEDITOR.config.resize_dir = 'both';
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy