]> source.dussan.org Git - vaadin-framework.git/commitdiff
fixes #4279
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Tue, 9 Mar 2010 12:51:44 +0000 (12:51 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Tue, 9 Mar 2010 12:51:44 +0000 (12:51 +0000)
svn changeset:11707/svn branch:6.3

src/com/vaadin/terminal/gwt/DefaultWidgetSet.gwt.xml
src/com/vaadin/terminal/gwt/client/ui/richtextarea/CustomWebkitRichTextArea.java [new file with mode: 0644]

index 2962ebbfd4d88b94f716ff321fc784894d823e4a..fde9d0d0242d9952f5dfd40328cd0a0e71c3f426 100644 (file)
                <when-property-is name="user.agent" value="ie6"/>
        </replace-with>
 
+       <!-- Safari needs a different implementation due to GWT bug. See #4279 (vaadin trac) -->
+       <replace-with class="com.vaadin.terminal.gwt.client.ui.richtextarea.CustomWebkitRichTextArea">
+               <when-type-is class="com.google.gwt.user.client.ui.impl.RichTextAreaImpl" />
+               <when-property-is name="user.agent" value="safari" />
+       </replace-with>
+
        <generate-with class="com.vaadin.terminal.gwt.widgetsetutils.WidgetMapGenerator">
                <when-type-is class="com.vaadin.terminal.gwt.client.WidgetMap"/>
        </generate-with>
diff --git a/src/com/vaadin/terminal/gwt/client/ui/richtextarea/CustomWebkitRichTextArea.java b/src/com/vaadin/terminal/gwt/client/ui/richtextarea/CustomWebkitRichTextArea.java
new file mode 100644 (file)
index 0000000..646616a
--- /dev/null
@@ -0,0 +1,35 @@
+/**
+ * 
+ */
+package com.vaadin.terminal.gwt.client.ui.richtextarea;
+
+import com.google.gwt.user.client.Command;
+import com.google.gwt.user.client.DeferredCommand;
+import com.google.gwt.user.client.Element;
+import com.google.gwt.user.client.ui.impl.RichTextAreaImplSafari;
+
+/**
+ * TODO remove me when GWT RichTextArea is fixed. See #4279 (vaadin trac)
+ * 
+ */
+class CustomWebkitRichTextArea extends RichTextAreaImplSafari {
+    public CustomWebkitRichTextArea() {
+        DeferredCommand.addCommand(new Command() {
+            public void execute() {
+                hookBlur(getElement());
+            }
+        });
+    }
+
+    private native void hookBlur(Element iframe)
+    /*-{
+
+        iframe.contentDocument.documentElement.onblur = function(evt) {
+          if (iframe.__listener) {
+            iframe.__listener.@com.google.gwt.user.client.ui.Widget::onBrowserEvent(Lcom/google/gwt/user/client/Event;)(evt);
+          }
+        };
+        
+        
+    }-*/;
+}
\ No newline at end of file