Skip to content
This repository

Could not disable enableObjectResizing #732

Closed
lightsurge opened this Issue September 26, 2012 · 15 comments

8 participants

lightsurge Rene Kapusta Alexander Ulitin Dominique Guardiola deliminator Wim Leers Kadoudal Karthik
lightsurge

I get an error only in Firefox:

[Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMHTMLDocument.execCommand]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /modules/aloha/build/alohaeditor/lib/aloha.js?v=custom%20build:%200.21.2%20+%20patches :: :: line 29" data: no]: Could not disable enableObjectResizing

This error also fires on the aloha website examples http://aloha-editor.org/demos/3col/

I think this is because Aloha is calling document.enableObjectResizing and document isn't contenteditable, so in Firefox will cause above error unless document.designMode = 'On', but doing that will make the whole document editable, which obviously we don't want (we'd only want that if we were making the contents of an iframe editable).

Try this example in Firefox latest http://chris.photobooks.com/tests/rte/moz_resizing/moz_resizing.html if you try to disable object resizing in this example before putting the frame into design mode (first set of buttons) it'll log an error, set designmode on first and it won't.

Shouldn't Aloha only be disabling object resizing for its own contenteditable body rather than the whole document?

Alexander Ulitin

+1

Dominique Guardiola

Please @evo42 ,
what is the recommended quick fix for this on aloha 0.20.20 ?
I have JS blocked on several sites because of this bug since the FF15 update...

lightsurge

evo42 may have a better interim solution but you could just comment out the appropriate line in core.js (470) and rebuild, or change Aloha.log.error to Aloha.log.log so that it doesn't generate a console error? The outcome will simply be that Aloha cannot disable image resizing in Firefox, which is fairly minor imo unless that means other things break, but by doing the former you prevent Aloha from triggering a red light in Firefox.

https://github.com/alohaeditor/Aloha-Editor/blob/dev/src/lib/aloha/core.js#L470

deliminator
Owner

It would be good to know what your problem is.

The call to Aloha.Log.error() that @lightsurge suggested doesn't do anything except log something into the console. Commenting it out will not fix any javascript errors. (The error that gets logged looks like a javascript error, but it really isnt').

Also, I tried the boilerplate and block demos with Firefox 15 without any problems. Can you provide instructions to reproduce the problem?

lightsurge

The error that gets logged looks like a javascript error, but it really isnt').

That's pretty much what I meant although granted I wasn't very clear, that if the problem is just that an error is logged in the console at all, and you can live with the native object resizing controls not being disabled in the interim, then removing the call to log it would fix that.

Think I may have wrongly assumed that was other people's experience as well if JS is actually outright breaking for them, rather than the console error just having other inadvertent side-effects maybe with their client-side environment.

Also, I tried the boilerplate and block demos with Firefox 15 without any problems. Can you provide instructions to reproduce the problem?

So there was no error logged in the console by Aloha?

lightsurge

Steps to reproduce it for me are just:
1. Open firefox
2. Open firebug > console tab
3. Go to http://aloha-editor.org/demos/3col/

deliminator
Owner

Thank's, I can reproduce the issue with the 3col demo.

I assumed that people were having javascript errors since the person in the linked issue has one. I suppose that must be unrelated to the enable/disable object resizing issue then.

Wim Leers

Any ideas on how to fix this one?

Wim Leers

Maybe Norbert can fix this? It sounds like a very easy fix for him, it'd be harder for me, not being familiar with what I could potentially break.

Kadoudal

+1

Rene Kapusta
Collaborator

fixed with 9e803cd

Rene Kapusta evo42 closed this January 21, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.