Skip to content

Commit

Permalink
Merge branch 't/12746' into major
Browse files Browse the repository at this point in the history
  • Loading branch information
Piotr Jasiun committed Feb 23, 2015
2 parents e9db567 + 24fd6ef commit 30311d4
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES.md
Expand Up @@ -23,6 +23,7 @@ New Features:
* [#11461](http://dev.ckeditor.com/ticket/11461): Introduced support for uploading pasted and dropped images with architecture for handling other types.
* [#12810](http://dev.ckeditor.com/ticket/12810): Introduced [notifications aggregator](http://docs.ckeditor.com/#!/api/CKEDITOR.plugins.notificationAggregator) for the [notifications system](http://docs.ckeditor.com/#!/api/CKEDITOR.plugins.notification).
* [#11636](http://dev.ckeditor.com/ticket/11636): Introduce new, focused on UX, methods for getting selected HTML and deleting it.
* [#12746](http://dev.ckeditor.com/ticket/12746): Config option to hide [Enhanced Image](http://ckeditor.com/addon/image2) resizer.

Fixed Issues:

Expand Down
12 changes: 11 additions & 1 deletion plugins/image2/plugin.js
Expand Up @@ -424,7 +424,7 @@

// Setup dynamic image resizing with mouse.
// Don't initialize resizer when dimensions are disallowed (#11004).
if ( editor.filter.checkFeature( this.features.dimension ) )
if ( editor.filter.checkFeature( this.features.dimension ) && editor.config.image2_disableResizer !== true )
setupResizer( this );

this.shiftState = helpers.stateShifter( this.editor );
Expand Down Expand Up @@ -1332,6 +1332,7 @@
if ( !enabled )
this.setState( CKEDITOR.TRISTATE_DISABLED );
else {
// jscs:disable
this.setState(
( widget.data.align == value ) ?
CKEDITOR.TRISTATE_ON
Expand All @@ -1340,6 +1341,7 @@
CKEDITOR.TRISTATE_OFF
:
CKEDITOR.TRISTATE_DISABLED );
// jscs:enable
}

evt.cancel();
Expand Down Expand Up @@ -1544,6 +1546,14 @@ CKEDITOR.config.image2_captionedClass = 'image';
* @member CKEDITOR.config
*/

/**
* Disables the image resizer. By default the resizer is enabled.
*
* @since 4.5.0
* @cfg {Boolean} [image2_disableResizer=false]
* @member CKEDITOR.config
*/

/**
* CSS classes applied to aligned images. Useful to take control over the way
* the images are aligned, i.e. to customize output HTML and integrate external stylesheets.
Expand Down
29 changes: 29 additions & 0 deletions tests/plugins/image2/manual/resizer.html
@@ -0,0 +1,29 @@
<div id="editor1" contenteditable="true">
<img src="%BASE_PATH%/_assets/logo.png" />
</div>
<div id="editor2" contenteditable="true">
<img src="%BASE_PATH%/_assets/logo.png" />
</div>
<div id="editor3" contenteditable="true">
<img src="%BASE_PATH%/_assets/logo.png" />
</div>
<div id="editor4" contenteditable="true">
<img src="%BASE_PATH%/_assets/logo.png" />
</div>

<script>
CKEDITOR.replace( 'editor1', {
disallowedContent : 'img{width, height}[width, height]',
image2_disableResizer: true
} );

CKEDITOR.replace( 'editor2', {
disallowedContent : 'img{width, height}[width, height]'
} );

CKEDITOR.replace( 'editor3', {
image2_disableResizer: true
} );

CKEDITOR.replace( 'editor4' );
</script>
5 changes: 5 additions & 0 deletions tests/plugins/image2/manual/resizer.md
@@ -0,0 +1,5 @@
@bender-tags: 4.5.0, tc
@bender-ui: collapsed
@bender-ckeditor-plugins: wysiwygarea, toolbar, image2

Only **last** editor should have enabled mouse resizer on image and two last should have enabled dimensions inputs in plugin dialog.

0 comments on commit 30311d4

Please sign in to comment.