Ticket #4231: 4231_2.patch
File 4231_2.patch, 2.4 KB (added by , 14 years ago) |
---|
-
_source/plugins/resize/plugin.js
11 11 12 12 if ( config.resize_enabled ) 13 13 { 14 var container = null; 15 var origin, startSize; 14 var container = null, 15 origin, 16 startSize, 17 resizeHorizontal = ( config.resize_dir == 'both' || config.resize_dir == 'horizontal' ) && 18 ( config.resize_minWidth != config.resize_maxWidth ), 19 resizeVertical = ( config.resize_dir == 'both' || config.resize_dir == 'vertical' ) && 20 ( config.resize_minHeight != config.resize_maxHeight ); 16 21 17 22 function dragHandler( evt ) 18 23 { 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; 24 var dx = evt.data.$.screenX - origin.x, 25 dy = evt.data.$.screenY - origin.y, 26 width = startSize.width, 27 height = startSize.height, 28 internalWidth = width + dx * ( editor.lang.dir == 'rtl' ? -1 : 1 ), 29 internalHeight = height + dy; 23 30 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 ) ) ); 31 if ( resizeHorizontal ) 32 width = Math.max( config.resize_minWidth, Math.min( internalWidth, config.resize_maxWidth ) ); 33 34 if ( resizeVertical ) 35 height = Math.max( config.resize_minHeight, Math.min( internalHeight, config.resize_maxHeight ) ); 36 37 editor.resize( width, height ); 26 38 } 27 39 28 40 function dragEndHandler ( evt ) … … 108 120 CKEDITOR.config.resize_maxHeight = 3000; 109 121 110 122 /** 111 * Whether to enable the resizing feature. If disab ed the resize handler will not be visible.123 * Whether to enable the resizing feature. If disabled the resize handler will not be visible. 112 124 * @type Boolean 113 125 * @default true 114 126 * @example 115 127 * config.resize_enabled = false; 116 128 */ 117 129 CKEDITOR.config.resize_enabled = true; 130 131 /** 132 * The directions where resizing is enabled. It can be 'both', 'vertical' or 'horizontal' 133 * @type String 134 * @default 'both' 135 * @since 3.3 136 * @example 137 * config.resize_dir = 'vertical'; 138 */ 139 140 CKEDITOR.config.resize_dir = 'both'; 141 No newline at end of file