Opened 15 years ago

Closed 14 years ago

#4208 closed Bug (fixed)

disableObjectResizing does not work with IE

Reported by: Sa'ar Zac Elias Owned by: Sa'ar Zac Elias
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 (3)

disable_object_resizing_ie.patch (909 bytes) - added by Jonathon Sim 15 years ago.
Patch to disable resizing in IE (against ckeditor trunk)
4208.patch (1.7 KB) - added by Sa'ar Zac Elias 14 years ago.
4208_2.patch (1.4 KB) - added by Sa'ar Zac Elias 14 years ago.

Download all attachments as: .zip

Change History (27)

comment:1 Changed 15 years ago by Sa'ar Zac Elias

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 15 years ago by Alfonso Martínez de Lizarrondo

This is a Firefox-only feature.

#4224 has been marked as dup.

comment:3 Changed 15 years ago by Sa'ar Zac Elias

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 15 years ago by Sa'ar Zac Elias

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 15 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 15 years ago by Sa'ar Zac Elias

Well, do you have any updates?

comment:7 Changed 15 years ago by raskri

BUMP

comment:8 Changed 15 years ago by Inez Korczyński

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 15 years ago by Sa'ar Zac Elias

Milestone: CKEditor 3.x

comment:10 Changed 15 years ago by Sa'ar Zac Elias

Milestone: CKEditor 3.xCKEditor 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 15 years ago by Frederico Caldeira Knabben

Milestone: CKEditor 3.3CKEditor 3.x

Changed 15 years ago by Jonathon Sim

Patch to disable resizing in IE (against ckeditor trunk)

comment:12 Changed 15 years ago by Jonathon Sim

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 Changed 15 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 ; Changed 15 years ago by Jonathon Sim

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 15 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 14 years ago by Frederico Caldeira Knabben

Milestone: CKEditor 3.x

Milestone CKEditor 3.x deleted

comment:17 Changed 14 years ago by Sa'ar Zac Elias

Owner: set to Sa'ar Zac Elias
Status: newassigned

#5563 did not resolve the issue.

Changed 14 years ago by Sa'ar Zac Elias

Attachment: 4208.patch added

comment:18 Changed 14 years ago by Sa'ar Zac Elias

Status: assignedreview

comment:19 Changed 14 years ago by Wiktor Walc

Milestone: CKEditor 3.5.1
Version: 3.0

comment:20 Changed 14 years ago by Garry Yao

Keywords: Discussion removed
Status: reviewreview_passed

comment:21 Changed 14 years ago by Garry Yao

Status: review_passedreview_failed

"disableNativeTableHandles" should not be handled by this plugin.

Changed 14 years ago by Sa'ar Zac Elias

Attachment: 4208_2.patch added

comment:22 Changed 14 years ago by Sa'ar Zac Elias

Status: review_failedreview

True, I've missed that before.

comment:23 Changed 14 years ago by Garry Yao

Status: reviewreview_passed

comment:24 Changed 14 years ago by Sa'ar Zac Elias

Resolution: fixed
Status: review_passedclosed

Fixed with [6291].

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy