Skip to content
Permalink
Browse files

Merge branch 't/9317'

  • Loading branch information...
Reinmar committed Jul 4, 2014
2 parents 731ec29 + ea96d87 commit 00ca2c07b0a9ac3aae6a7fb5a2b32cf5fc56fceb
Showing with 51 additions and 20 deletions.
  1. +1 −0 CHANGES.md
  2. +50 −20 plugins/wysiwygarea/plugin.js
@@ -9,6 +9,7 @@ Fixed Issues:
* [#11897](http://dev.ckeditor.com/ticket/11897): Fixed: Enter key in an empty formatted list item, creates a new line instead of breaking the list. Thanks to [noam-si](https://github.com/noam-si)!
* [#12140](http://dev.ckeditor.com/ticket/12140): Fixed: Double-clicking linked widgets opens two dialogs.
* [#12132](http://dev.ckeditor.com/ticket/12132): Fixed: Image is inserted with `width` and `height` styles even when they are not allowed.
* [#9317](http://dev.ckeditor.com/ticket/9317): [IE] Fixed: [`config.disableObjectResizing`](http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-disableObjectResizing) does not work on IE. **Note**: We were not able to fix this issue on IE11+ because necessary events stopped working. See a [last resort workaround](http://dev.ckeditor.com/ticket/9317#comment:16) and make sure to [support our complaint](https://connect.microsoft.com/IE/feedback/details/742593/please-respect-execcommand-enableobjectresizing-in-contenteditable-elements).

## CKEditor 4.4.2

@@ -220,29 +220,14 @@
} );
}

// ## START : disableNativeTableHandles and disableObjectResizing settings.
// Config props: disableObjectResizing and disableNativeTableHandles handler.
objectResizeDisabler( editor );

// Enable dragging of position:absolute elements in IE.
try {
editor.document.$.execCommand( '2D-position', false, true );
} catch ( e ) {}

// IE, Opera and Safari may not support it and throw errors.
try {
editor.document.$.execCommand( 'enableInlineTableEditing', false, !editor.config.disableNativeTableHandles );
} catch ( e ) {}

if ( editor.config.disableObjectResizing ) {
try {
this.getDocument().$.execCommand( 'enableObjectResizing', false, false );
} catch ( e ) {
// For browsers in which the above method failed, we can cancel the resizing on the fly (#4208)
this.attachListener( this, CKEDITOR.env.ie ? 'resizestart' : 'resize', function( evt ) {
evt.data.preventDefault();
} );
}
}

if ( CKEDITOR.env.gecko || CKEDITOR.env.ie && editor.document.$.compatMode == 'CSS1Compat' ) {
this.attachListener( this, 'keydown', function( evt ) {
var keyCode = evt.data.getKeystroke();
@@ -297,9 +282,6 @@
} );
}

// ## END


var title = editor.document.getElementsByTag( 'title' ).getItem( 0 );
title.data( 'cke-title', editor.document.$.title );

@@ -566,6 +548,48 @@
}
} );

function objectResizeDisabler( editor ) {
if ( CKEDITOR.env.gecko ) {
// FF allows to change resizing preferences by calling execCommand.
try {
var doc = editor.document.$;
doc.execCommand( 'enableObjectResizing', false, !editor.config.disableObjectResizing );
doc.execCommand( 'enableInlineTableEditing', false, !editor.config.disableNativeTableHandles );
} catch( e ) {}
} else if ( CKEDITOR.env.ie && CKEDITOR.env.version < 11 && editor.config.disableObjectResizing ) {
// It's possible to prevent resizing up to IE10.
blockResizeStart( editor );
}

// Disables resizing by preventing default action on resizestart event.
function blockResizeStart() {
var lastListeningElement;

// We'll attach only one listener at a time, instead of adding it to every img, input, hr etc.
// Listener will be attached upon selectionChange, we'll also check if there was any element that
// got listener before (lastListeningElement) - if so we need to remove previous listener.
editor.editable().attachListener( editor, 'selectionChange', function() {
var selectedElement = editor.getSelection().getSelectedElement();

if ( selectedElement ) {
if ( lastListeningElement ) {
lastListeningElement.detachEvent( 'onresizestart', resizeStartListener );
lastListeningElement = null;
}

// IE requires using attachEvent, because it does not work using W3C compilant addEventListener,
// tested with IE10.
selectedElement.$.attachEvent( 'onresizestart', resizeStartListener );
lastListeningElement = selectedElement.$;
}
} );
}

function resizeStartListener( evt ) {
evt.returnValue = false;
}
}

// DOM modification here should not bother dirty flag.(#4385)
function restoreDirty( editor ) {
if ( !editor.checkDirty() )
@@ -611,6 +635,12 @@
*
* config.disableObjectResizing = true;
*
* **Note:** Because of incomplete implementation of editing features in browsers
* this option does not work for inline editors (see ticket [#10197](http://dev.ckeditor.com/ticket/10197)),
* does not work on IE11+ (see [#9317](http://dev.ckeditor.com/ticket/9317#comment:16) and
* [IE11+ issue](https://connect.microsoft.com/IE/feedback/details/742593/please-respect-execcommand-enableobjectresizing-in-contenteditable-elements))
* and on IE8-10 this option only blocks resizing (it can't hide resize handles).
*
* @cfg
* @member CKEDITOR.config
*/

0 comments on commit 00ca2c0

Please sign in to comment.
You can’t perform that action at this time.