Ticket #4231: 4231.patch

File 4231.patch, 1.4 KB (added by Alfonso Martínez de Lizarrondo, 14 years ago)

Proposed patch

  • _source/plugins/resize/plugin.js

     
    1616
    1717                        function dragHandler( evt )
    1818                        {
    19                                 var dx = evt.data.$.screenX - origin.x;
    20                                 var dy = evt.data.$.screenY - origin.y;
    21                                 var internalWidth = startSize.width + dx * ( editor.lang.dir == 'rtl' ? -1 : 1 );
    22                                 var internalHeight = startSize.height + dy;
     19                                var dx = evt.data.$.screenX - origin.x,
     20                                        dy = evt.data.$.screenY - origin.y,
     21                                        width = startSize.width,
     22                                        height = startSize.height,
     23                                        internalWidth = width + dx * ( editor.lang.dir == 'rtl' ? -1 : 1 ),
     24                                        internalHeight = height + dy;
    2325
    24                                 editor.resize( Math.max( config.resize_minWidth, Math.min( internalWidth, config.resize_maxWidth ) ),
    25                                                 Math.max( config.resize_minHeight, Math.min( internalHeight, config.resize_maxHeight ) ) );
     26                                if ( config.resize_minWidth != config.resize_maxWidth )
     27                                        width =  Math.max( config.resize_minWidth, Math.min( internalWidth, config.resize_maxWidth ) );
     28
     29                                if ( config.resize_minHeight != config.resize_maxHeight )
     30                                        height =  Math.max( config.resize_minHeight, Math.min( internalHeight, config.resize_maxHeight ) );
     31
     32                                editor.resize( width, height );
    2633                        }
    2734
    2835                        function dragEndHandler ( evt )
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy