X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Fresize%2Fplugin.js;h=571ac530e5f9ed9f27b85537a41804f1d979a971;hb=039a051ccf3901311661022a30afd60fc38130c9;hp=8c250355ab0acbba875a71a29457903e1ba81f4e;hpb=8665a7c6c60586526e32e8941fe2896739b6ebfb;p=ckeditor.git diff --git a/_source/plugins/resize/plugin.js b/_source/plugins/resize/plugin.js index 8c25035..571ac53 100644 --- a/_source/plugins/resize/plugin.js +++ b/_source/plugins/resize/plugin.js @@ -9,7 +9,13 @@ CKEDITOR.plugins.add( 'resize', { var config = editor.config; - if ( config.resize_enabled ) + !config.resize_dir && ( config.resize_dir = 'both' ); + ( config.resize_maxWidth == undefined ) && ( config.resize_maxWidth = 3000 ); + ( config.resize_maxHeight == undefined ) && ( config.resize_maxHeight = 3000 ); + ( config.resize_minWidth == undefined ) && ( config.resize_minWidth = 750 ); + ( config.resize_minHeight == undefined ) && ( config.resize_minHeight = 250 ); + + if ( config.resize_enabled !== false ) { var container = null, origin, @@ -57,6 +63,9 @@ CKEDITOR.plugins.add( 'resize', startSize = { width : container.$.offsetWidth || 0, height : container.$.offsetHeight || 0 }; origin = { x : $event.screenX, y : $event.screenY }; + config.resize_minWidth > startSize.width && ( config.resize_minWidth = startSize.width ); + config.resize_minHeight > startSize.height && ( config.resize_minHeight = startSize.height ); + CKEDITOR.document.on( 'mousemove', dragHandler ); CKEDITOR.document.on( 'mouseup', dragEndHandler ); @@ -74,9 +83,9 @@ CKEDITOR.plugins.add( 'resize', if ( event.data.space == 'bottom' ) { var direction = ''; - if ( resizeHorizontal && !resizeVertical) + if ( resizeHorizontal && !resizeVertical ) direction = ' cke_resizer_horizontal'; - if ( !resizeHorizontal && resizeVertical) + if ( !resizeHorizontal && resizeVertical ) direction = ' cke_resizer_vertical'; event.data.html += '