IE11 Cosmetics #PL-5171

This commit is contained in:
Yuriy Artamonov 2015-04-03 11:51:50 +00:00
parent 9979deb78d
commit 00d1f61daf
2 changed files with 10 additions and 21 deletions

View File

@ -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) /*-{

View File

@ -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");
}
}-*/;
}