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;
}
}
- /**
- * 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
*/
if (dragmode != 0
&& (event.getButton() == NativeEvent.BUTTON_LEFT)) {
startRowDrag(event, type, targetTdOrTr);
+
} else if (event.getCtrlKey()
|| event.getShiftKey()
|| event.getMetaKey()
((Element) event.getEventTarget().cast())
.setPropertyJSO(
"onselectstart",
- applyDisableTextSelectionIEHack());
+ getPreventTextSelectionIEHack());
}
event.stopPropagation();
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; };
+ }-*/;
+
}