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)
Change History (27)
comment:1 Changed 15 years ago by
comment:3 Changed 15 years ago by
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
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
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:8 Changed 15 years ago by
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
Milestone: | → CKEditor 3.x |
---|
comment:10 Changed 15 years ago by
Milestone: | CKEditor 3.x → 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 15 years ago by
Milestone: | CKEditor 3.3 → CKEditor 3.x |
---|
Changed 15 years ago by
Attachment: | disable_object_resizing_ie.patch added |
---|
Patch to disable resizing in IE (against ckeditor trunk)
comment:12 Changed 15 years ago by
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 15 years ago by
@jonathonsim Thanks for the patch, the problem is supposed to be tackled by #5563.
comment:14 follow-up: 15 Changed 15 years ago by
comment:15 Changed 15 years ago by
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:17 Changed 14 years ago by
Owner: | set to Sa'ar Zac Elias |
---|---|
Status: | new → assigned |
#5563 did not resolve the issue.
Changed 14 years ago by
Attachment: | 4208.patch added |
---|
comment:18 Changed 14 years ago by
Status: | assigned → review |
---|
comment:19 Changed 14 years ago by
Milestone: | → CKEditor 3.5.1 |
---|---|
Version: | → 3.0 |
comment:20 Changed 14 years ago by
Keywords: | Discussion removed |
---|---|
Status: | review → review_passed |
comment:21 Changed 14 years ago by
Status: | review_passed → review_failed |
---|
"disableNativeTableHandles" should not be handled by this plugin.
Changed 14 years ago by
Attachment: | 4208_2.patch added |
---|
comment:23 Changed 14 years ago by
Status: | review → review_passed |
---|
comment:24 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | review_passed → closed |
Fixed with [6291].
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.