]> source.dussan.org Git - vaadin-framework.git/commitdiff
fixes #6956
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Tue, 10 May 2011 08:33:48 +0000 (08:33 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Tue, 10 May 2011 08:33:48 +0000 (08:33 +0000)
svn changeset:18734/svn branch:6.6

src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java
src/com/vaadin/terminal/gwt/client/ui/dd/VDragAndDropManager.java

index 13d73e7291c5fedba565d38cdd747928f2cccc9e..c1d674a367bb0f429603fb5af660215a97bc0ece 100644 (file)
@@ -823,6 +823,14 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler,
 
         dragmode = uidl.hasAttribute("dragmode") ? uidl
                 .getIntAttribute("dragmode") : 0;
+        if (BrowserInfo.get().isIE()) {
+            if (dragmode > 0) {
+                getElement().setPropertyJSO("onselectstart",
+                        getPreventTextSelectionIEHack());
+            } else {
+                getElement().setPropertyJSO("onselectstart", null);
+            }
+        }
 
         tabIndex = uidl.hasAttribute("tabindex") ? uidl
                 .getIntAttribute("tabindex") : 0;
@@ -4230,19 +4238,6 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler,
                 }
             }
 
-            /**
-             * Add this to the element mouse down event by using
-             * element.setPropertyJSO
-             * ("onselectstart",applyDisableTextSelectionIEHack()); Remove it
-             * then again when the mouse is depressed in the mouse up event.
-             * 
-             * @return Returns the JSO preventing text selection
-             */
-            private native JavaScriptObject applyDisableTextSelectionIEHack()
-            /*-{
-                    return function(){ return false; };
-            }-*/;
-
             /*
              * React on click that occur on content cells only
              */
@@ -4450,6 +4445,7 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler,
                             if (dragmode != 0
                                     && (event.getButton() == NativeEvent.BUTTON_LEFT)) {
                                 startRowDrag(event, type, targetTdOrTr);
+
                             } else if (event.getCtrlKey()
                                     || event.getShiftKey()
                                     || event.getMetaKey()
@@ -4464,7 +4460,7 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler,
                                     ((Element) event.getEventTarget().cast())
                                             .setPropertyJSO(
                                                     "onselectstart",
-                                                    applyDisableTextSelectionIEHack());
+                                                    getPreventTextSelectionIEHack());
                                 }
 
                                 event.stopPropagation();
@@ -5989,4 +5985,17 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler,
     public String getPaintableId() {
         return paintableId;
     }
+
+    /**
+     * Add this to the element mouse down event by using element.setPropertyJSO
+     * ("onselectstart",applyDisableTextSelectionIEHack()); Remove it then again
+     * when the mouse is depressed in the mouse up event.
+     * 
+     * @return Returns the JSO preventing text selection
+     */
+    private static native JavaScriptObject getPreventTextSelectionIEHack()
+    /*-{
+            return function(){ return false; };
+    }-*/;
+
 }
index ecb57a49ced5f8de6506f95afad5f98efdfbe1fd..a7e738621d04992eeb1442de2f2581570c6ad911 100644 (file)
@@ -368,6 +368,7 @@ public class VDragAndDropManager {
                             case Event.ONKEYPRESS:
                             case Event.ONKEYUP:
                             case Event.ONBLUR:
+                            case Event.ONFOCUS:
                                 // don't cancel possible drag start
                                 break;
                             case Event.ONMOUSEOUT: