Author: [email protected]
Date: Mon Jun 29 10:31:37 2009
New Revision: 5636
Modified:
trunk/user/src/com/google/gwt/user/client/ui/impl/RichTextAreaImplMozilla.java
Log:
Fixes an issue with a missing text caret in the RichTextArea in FF.
Patch by: jlabanca
Review by: jgw
Issue: 1441
Modified:
trunk/user/src/com/google/gwt/user/client/ui/impl/RichTextAreaImplMozilla.java
==============================================================================
---
trunk/user/src/com/google/gwt/user/client/ui/impl/RichTextAreaImplMozilla.java
(original)
+++
trunk/user/src/com/google/gwt/user/client/ui/impl/RichTextAreaImplMozilla.java
Mon Jun 29 10:31:37 2009
@@ -36,14 +36,26 @@
// Send notification that the iframe has finished loading.
_th...@com.google.gwt.user.client.ui.impl.richtextareaimplstandard::onElementInitialized()();
- // Don't set designMode until the RTA actually gets focused. This is
+ // Don't set designMode until the RTA is targeted by an event. This
is
// necessary because editing won't work on Mozilla if the iframe is
- // *hidden, but attached*. Waiting for focus gets around this issue.
+ // *hidden, but attached*. Waiting for an event gets around this
issue.
//
- // Note: This onfocus will not conflict with the
addEventListener('focus',
- // ...) // in RichTextAreaImplStandard.
+ // Note: These events will not conflict with the
+ // addEventListener('oneventtype', ...) in RichTextAreaImplStandard.
iframe.contentWindow.onfocus = function() {
iframe.contentWindow.onfocus = null;
+ iframe.contentWindow.onmouseover = null;
+ iframe.contentWindow.document.designMode = 'On';
+ };
+
+ // Issue 1441: we also need to catch the onmouseover event because
focus
+ // occurs after mouse down, so the cursor will not appear until the
user
+ // clicks twice, making the RichTextArea look uneditable. Catching
the
+ // mouseover event allows us to set design mode earlier. The focus
event
+ // is still needed to handle tab selection.
+ iframe.contentWindow.onmouseover = function() {
+ iframe.contentWindow.onfocus = null;
+ iframe.contentWindow.onmouseover = null;
iframe.contentWindow.document.designMode = 'On';
};
};
--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---