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 |
| Severity: | major | Keywords: | Editor2 designMode firefox |
| Cc: |
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
Note: See
TracTickets for help on using
tickets.