Hello,
I am getting a weird problem with firefox. Everything seems to be working, yet I'm getting an error "q is null". Going through the minified code, it shows this line:
var q=r.document.getSelection().getNative();
q.removeAllRanges();
q.addRange(p);
this translates into the unminified code in the plugin.js to about line 1363:
var selection = this.document.getSelection().getNative();
selection.removeAllRanges();
selection.addRange( nativeRange );
From this bug, I can assume that the selection variable is null. Is there a reason why this is assumed to never be null?
It seems to happen mostly when the ckeditor field is not displayed on the screen (i.e. in a div with a style="display:none", and I'm calling a CKEDITOR.replace() on it.
Putting a if(q!=null) around the 2 statements prevents this error.
I'm not sure if this is a bug, or if I'm using this incorrectly.
Thanks
I am getting a weird problem with firefox. Everything seems to be working, yet I'm getting an error "q is null". Going through the minified code, it shows this line:
var q=r.document.getSelection().getNative();
q.removeAllRanges();
q.addRange(p);
this translates into the unminified code in the plugin.js to about line 1363:
var selection = this.document.getSelection().getNative();
selection.removeAllRanges();
selection.addRange( nativeRange );
From this bug, I can assume that the selection variable is null. Is there a reason why this is assumed to never be null?
It seems to happen mostly when the ckeditor field is not displayed on the screen (i.e. in a div with a style="display:none", and I'm calling a CKEDITOR.replace() on it.
Putting a if(q!=null) around the 2 statements prevents this error.
I'm not sure if this is a bug, or if I'm using this incorrectly.
Thanks
Re: q is null
You might want to report this on http://dev.ckeditor.com yet my gut feeling is that replacing elements which are hidden using the CSS hidden attribute is not something which is supported. You will need to inquire.
My reasoning for this is that if you don't want to use CKEditor on an element, just don't.
If you are trying to avoid FOUC, then style the element without hiding it using CSS, so that it looks similar to how to looks after it is replaced and the skin is applied.
Hiding an element and then using CKEditor on it is similar to saying "No, but yeah." It makes little sense and isn't assertive enough to truly mean yes or no.
The ckeditor/_samples/ajax.html demo which ships with CKEditor might suit what you are trying to do, better than hiding the element?
Thanks,
Zanpakutō
Re: q is null
Re: q is null
This is the ticket for it:
http://dev.ckeditor.com/ticket/6577
Frederico Knabben
CKEditor Project Lead and CKSource Owner
--
Follow us on: Twitter | Facebook | Google+ | LinkedIn
Re: q is null
The item itself is actually replaced on screen, so I know I have the proper selector and soforth, but unfortunately ckeditor is never able to bind fully to that particular area.
Not sure how to proceed