Changes between Initial Version and Version 1 of Ticket #1511, comment 5


Ignore:
Timestamp:
Apr 19, 2013, 9:23:38 AM (7 years ago)
Author:
Jakub Ś
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #1511, comment 5

    initial v1  
    1 This is still an issue in latest CKEditor 4.1. Please use below code. You can try option one or two and then revert changes with undo toolbar button or execute undo command (option 3).[[BR]]
    2 Result is that image won't be resized to previous size.
     1<p>
     2        Type, paste something or start formatting this sample text to see plugin in action.
     3        <img alt="" src="http://upload.wikimedia.org/wikipedia/commons/1/17/Ferrari_F430_front_20080605.jpg" style="width: 225px; height: 160px;" /></p>
    34
     5This is still an issue in latest CKEditor 4.1. Problem can be reproduced in both CKE 3.x and 4.x (v4) in IE and Firefox and concerns resizing with native browser handles (Please also note that in CKEditor resizing image with CKEditor dialog is registered by undo manager).
     6
     7From CKEditor 3.0 through 3.6.6 till 4.0 beta you needed to “trigger” undo manager to get this working.
     8If you had used below initial code you had to first e.g. type letter then resize image so that undo manager could catch it. Another option to trigger undo manager was pasting below code in source mode, switching to WYSIWYG and then resizing image
    49{{{
    5 editor.on('instanceReady', function(evt){
    6                 var editable = editor.editable();               
    7                 var doc = editable.getDocument();       
    8                 var helper = doc.getById('aa');         
    9                 setTimeout(function(){
    10                         helper.removeClass( 'right' );                 
    11                        
    12                         //1#
    13                         /*helper.setStyles( {
    14                                 'width': '213px',
    15                                 'height': '203px'
    16                         } );*/
    17                        
    18                         //2#
    19                         helper.removeStyle('width');
    20                         helper.removeStyle('height');
    21                         helper.setSize('width', 213, true);
    22                         helper.setSize('height', 201, true);           
    23                 }, 1000);               
    24                 //3#
    25                 //setTimeout(function(){editor.execCommand( 'undo' );}, 2000);
    26 });     
     10<p>
     11        Type, paste something or start formatting this sample text to see plugin in action.
     12        <img alt="" src="http://upload.wikimedia.org/wikipedia/commons/1/17/Ferrari_F430_front_20080605.jpg" style="width: 225px; height: 160px;" /></p>
    2713}}}
    2814
    29 Problem can be reproduced in both CKE 3.x and 4.x (v4).
    30 ----
    31 
    32 Please also note that in CKEditor resizing image with CKEditor dialog is registered by undo manager. [[BR]]
    33 When using native resize handles such event isn't caught. Unfortunately there doesn't seem to be any workaround for this. According to http://help.dottoro.com/ljorlllt.php 'resize' event is available for window element only in non-ie browsers. There is no resize event for images when resized with native handles. This part is ‘won't fix’ issue in Firefox and IE.
     15In CKEditor 4.0 behaviour has changed as resizing image with native handles isn’t caught at all or almost at all. You can still trigger undo manager in the same way as for CKE 3.0 – 4 beta but now image resize won’t be reverted separately.
     16Let’s say you have loaded initial code, typed letter and then resized image. From CKEditor 4.0 pressing undo will revert both typed letter and resized image.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy