mirror of
https://gitee.com/jmix/cuba.git
synced 2024-12-03 03:38:33 +08:00
IE11 Cosmetics #PL-5171
This commit is contained in:
parent
9979deb78d
commit
00d1f61daf
@ -14,8 +14,8 @@ import com.google.gwt.dom.client.Element;
|
||||
public class ToolsImpl {
|
||||
|
||||
protected native void setTextSelectionEnable(Element el) /*-{
|
||||
if (typeof $doc.textSelectionFalseFunction != "function") {
|
||||
$doc.textSelectionFalseFunction = function() {
|
||||
if (typeof $wnd.textSelectionFalseFunction != "function") {
|
||||
$wnd.textSelectionFalseFunction = function() {
|
||||
return false;
|
||||
};
|
||||
}
|
||||
@ -24,13 +24,13 @@ public class ToolsImpl {
|
||||
}-*/;
|
||||
|
||||
protected native void setTextSelectionDisable(Element el) /*-{
|
||||
if (typeof $doc.textSelectionFalseFunction != "function") {
|
||||
$doc.textSelectionFalseFunction = function() {
|
||||
if (typeof $wnd.textSelectionFalseFunction != "function") {
|
||||
$wnd.textSelectionFalseFunction = function() {
|
||||
return false;
|
||||
};
|
||||
}
|
||||
|
||||
el.removeEventListener("selectstart", $doc.textSelectionFalseFunction, true);
|
||||
el.removeEventListener("selectstart", $wnd.textSelectionFalseFunction, true);
|
||||
}-*/;
|
||||
|
||||
public native void textSelectionEnable(Element el, boolean enable) /*-{
|
||||
|
@ -17,20 +17,15 @@ public class ToolsImplIE extends ToolsImpl {
|
||||
protected native void setTextSelectionEnable(Element el) /*-{
|
||||
if (typeof el.style == "undefined")
|
||||
el.style = {};
|
||||
el.setAttribute('onselectstart', null);
|
||||
el.style.msUserSelect = "";
|
||||
|
||||
if (el.style.setProperty) {
|
||||
el.style.setProperty("user-select", "");
|
||||
} else {
|
||||
el.style.setAttribute("user-select", "");
|
||||
}
|
||||
el.onselectstart = null;
|
||||
el.style.msUserSelect = "";
|
||||
}-*/;
|
||||
|
||||
@Override
|
||||
protected native void setTextSelectionDisable(Element el) /*-{
|
||||
if (typeof $doc.ieTextSelectionFalseFunction != "function") {
|
||||
$doc.ieTextSelectionFalseFunction = function() {
|
||||
if (typeof $wnd.ieTextSelectionFalseFunction != "function") {
|
||||
$wnd.ieTextSelectionFalseFunction = function() {
|
||||
return false;
|
||||
};
|
||||
}
|
||||
@ -39,13 +34,7 @@ public class ToolsImplIE extends ToolsImpl {
|
||||
el.style = {};
|
||||
}
|
||||
|
||||
el.setAttribute('onselectstart', $doc.ieTextSelectionFalseFunction);
|
||||
el.onselectstart = $wnd.ieTextSelectionFalseFunction;
|
||||
el.style.msUserSelect = "none";
|
||||
|
||||
if (el.style.setProperty) {
|
||||
el.style.setProperty("user-select", "none");
|
||||
} else {
|
||||
el.style.setAttribute("user-select", "none");
|
||||
}
|
||||
}-*/;
|
||||
}
|
Loading…
Reference in New Issue
Block a user