Ticket #4208 (closed Bug: fixed)

Opened 5 years ago

Last modified 3 years ago

disableObjectResizing does not work with IE

Reported by: Saare Owned by: Saare
Priority: Normal Milestone: CKEditor 3.5.1
Component: General Version: 3.0
Keywords: Cc: sim@…

Description

[IE] the config element disableObjectResizing does not work.

Attachments

disable_object_resizing_ie.patch (909 bytes) - added by jonathonsim 4 years ago.
Patch to disable resizing in IE (against ckeditor trunk)
4208.patch (1.7 KB) - added by Saare 4 years ago.
4208_2.patch (1.4 KB) - added by Saare 3 years ago.

Change History

comment:1 Changed 5 years ago by Saare

Seems that it does not work with both IE7 and IE8, both with FCKEditor V2 and CKEditor V3. maybe try to save the object's normal dimensions and force him to stay with these dimensions.

comment:2 Changed 5 years ago by alfonsoml

This is a Firefox-only feature.

#4224 has been marked as dup.

comment:3 Changed 5 years ago by Saare

As i said, you can maybe save the real dimensions of the object using a temporary attribute and force the element to stay with these dimensions using the selectionChange event for the objects.

comment:4 Changed 5 years ago by Saare

I've created a code that does the same action with other browsers as well (tested with IE8, Opera 9 and Safari 4. for FF 3 i've used the regular method:

iframe_document.execCommand('enableObjectResizing', false, false);

Unfortunately i'm not familier with CKEditor's API so the code is a plane javascript: 'When creating a resizable object:

/*obj = editor_document.createElement(...)*/
obj._originaldimensions = obj.height + '|' + obj.width + '|' + obj.style.height + '|' + obj.style.width;
obj.onresize = function(){
	var org = this._originaldimensions.split('|');
	if(this.height != org[0])
		this.height = org[0];
	if(this.width != org[1])
		this.width = org[1];
	if(this.style.height != org[2])
		this.style.height = org[2];
	if(this.style.width != org[3])
		this.style.width = org[3];
};

and when outputting the data, just remove the "_originaldimensions" attribute. pretty ugly, but i can't think of a better idea at the moment.

comment:5 Changed 5 years ago by garry.yao

  • Keywords Discussion added

@Sarre Thanks for the tips, it's reasonable to spread this feature to IE. The equivalent CKEditor code of your approach would be:

// Disable all elements resizing within document
body.on( 'resizestart', function ( evt ){
        evt.data.preventDefault();
} );

comment:6 Changed 5 years ago by Saare

Well, do you have any updates?

comment:7 Changed 5 years ago by raskri

BUMP

comment:8 Changed 4 years ago by Inez.Korczynski

I have somehow related problem. I want to block not only effect of resizing image, but I want to block displaying little grid with resize handlers around the image which is visible after single click (IE) or double click (FF). I need it for MediaWiki integration, where I use images to display kind of placeholder of elements which can not be rendered in Wysiwyg mode. Any ideas?

comment:9 Changed 4 years ago by Saare

  • Milestone set to CKEditor 3.x

comment:10 Changed 4 years ago by Saare

  • Milestone changed from CKEditor 3.x to CKEditor 3.3

According to my tests, in plain JS you only have to return false in the function. i'm not sure whether your event system works the same. In fact, this way of disabling the resizing will be better if you will be able to make it work in other browsers as well (the onresizestart event is only for IE as far as i know) because the handlers (i.e the white boxes around the images which control the resizing) are still being shown (they are hidden when using the original way).

comment:11 Changed 4 years ago by fredck

  • Milestone changed from CKEditor 3.3 to CKEditor 3.x

Changed 4 years ago by jonathonsim

Patch to disable resizing in IE (against ckeditor trunk)

comment:12 Changed 4 years ago by jonathonsim

  • Cc sim@… added

I've attached a patch to _source/plugins/wysiwygarea/plugin.js that we are using to disable this for IE (unfortunately the sort of people that will upload a 4mb image off their digital camera and then resize it to 100 pixels wide, then complain why their page is slow to load, almost all use IE)

It uses the basic idea suggested by others here, adding a handler to the IE onresizestart event:

// For IE, disable object resizing by stopping the resizestart event
if ( CKEDITOR.env.ie && editor.config.disableObjectResizing)
{
	domDocument.on( 'mousedown', function(ev) 
	{
			ev.data.getTarget().on( 'resizestart', function( ev2 ) 
			{
					ev2.data.preventDefault();
			} );
	});
}

comment:13 follow-up: ↓ 14 Changed 4 years ago by garry.yao

@jonathonsim Thanks for the patch, the problem is supposed to be tackled by #5563.

comment:14 in reply to: ↑ 13 ; follow-up: ↓ 15 Changed 4 years ago by jonathonsim

Replying to garry.yao:

@jonathonsim Thanks for the patch, the problem is supposed to be tackled by #5563.

Ahh so it is, I just tried applying that patch to our modified version of 3.2.1 and it does work in both IE and FF.

comment:15 in reply to: ↑ 14 Changed 4 years ago by garry.yao

Replying to jonathonsim:

Replying to garry.yao:

@jonathonsim Thanks for the patch, the problem is supposed to be tackled by #5563.

Ahh so it is, I just tried applying that patch to our modified version of 3.2.1 and it does work in both IE and FF.

The attachment:ticket:5563:5563.patch is to be applied on our 3.3.x branch.

comment:16 Changed 4 years ago by fredck

  • Milestone CKEditor 3.x deleted

Milestone CKEditor 3.x deleted

comment:17 Changed 4 years ago by Saare

  • Status changed from new to assigned
  • Owner set to Saare

#5563 did not resolve the issue.

Changed 4 years ago by Saare

comment:18 Changed 4 years ago by Saare

  • Status changed from assigned to review

comment:19 Changed 3 years ago by wwalc

  • Version set to 3.0
  • Milestone set to CKEditor 3.5.1

comment:20 Changed 3 years ago by garry.yao

  • Keywords Discussion removed
  • Status changed from review to review_passed

comment:21 Changed 3 years ago by garry.yao

  • Status changed from review_passed to review_failed

"disableNativeTableHandles" should not be handled by this plugin.

Changed 3 years ago by Saare

comment:22 Changed 3 years ago by Saare

  • Status changed from review_failed to review

True, I've missed that before.

comment:23 Changed 3 years ago by garry.yao

  • Status changed from review to review_passed

comment:24 Changed 3 years ago by Saare

  • Status changed from review_passed to closed
  • Resolution set to fixed

Fixed with [6291].

Note: See TracTickets for help on using tickets.
© 2003 – 2012 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy