Ticket #1301 (closed defect: duplicate)
Editor2 designMode="On" fails in hidden Editor2 Componente Firefox
| Reported by: | tjerk@… | Owned by: | alex |
|---|---|---|---|
| Priority: | high | Milestone: | 1.1 |
| Component: | Editor | Version: | 0.3 |
| Keywords: | Editor2 designMode firefox | Cc: | |
| Blocked by: | Blocking: |
Description (last modified by peller) (diff)
When using the Editor2 Component on a element (example: <textarea>) that is currently hidden ( for example: behind a tab) firefox will throw an exception (i added some enters for readability):
uncaught exception: [ Exception... "Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIDOMNSHTMLDocument.designMode]" nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)" location: "JS frame :: http://domainname.com/dojo/src/widget/templates/richtextframe.html# :: init :: line 9" data: no ]
I think it is a bug in the firefox designmode. Anyways the workaround is very simple... Change the javascriptcode in richtextframe.html to the following:
<script type="text/javascript">
function init(){
var parentPageDomain = document.location.href.split('#')[1];
if (parentPageDomain) {
document.domain = parentPageDomain;
}
}
window.onload = init;
window.onfocus = function() {
document.designMode = 'On';
}
</script>
Now designmode will only be toggled when the editor-page gets focus, and a page only gets focus when it is visible. Problem solved!
Change History
comment:3 Changed 6 years ago by liucougar
- Status changed from new to assigned
- Milestone changed from 0.5 to 0.4
comment:6 Changed 5 years ago by bill
- Milestone changed from 0.9 to 1.1
Hopefully this will fix itself when FF3 is release which has div with designmode rather than iframes.
comment:8 Changed 5 years ago by peller
- Priority changed from normal to high
Cougar, is this workaround acceptable? Is it something which can be incorporated into RichText??
comment:10 Changed 5 years ago by liucougar
it did not work as expected, last time I tried something similar to the patch
comment:11 Changed 5 years ago by alex
- Owner changed from liucougar to alex
- Status changed from assigned to new
comment:13 Changed 4 years ago by peller
- Status changed from assigned to closed
- Resolution set to duplicate
closed in favor of #5099