Improve native selection prevention on dnd
This commit is contained in:
parent
165cec553a
commit
cb7a0d5d47
2 changed files with 4 additions and 2 deletions
|
|
@ -5,6 +5,7 @@
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
line-height: normal;
|
line-height: normal;
|
||||||
color: black;
|
color: black;
|
||||||
|
-ms-user-select: none;
|
||||||
-moz-user-select: none;
|
-moz-user-select: none;
|
||||||
-webkit-user-select: none;
|
-webkit-user-select: none;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
|
|
|
||||||
|
|
@ -305,8 +305,6 @@ function DragdropHandler(mouseHandler) {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.onMouseDrag = function(e) {
|
this.onMouseDrag = function(e) {
|
||||||
if (useragent.isOpera)
|
|
||||||
document.getSelection().removeAllRanges();
|
|
||||||
if (useragent.isIE && this.state == "dragReady") {
|
if (useragent.isIE && this.state == "dragReady") {
|
||||||
// IE does not handle [draggable] attribute set after mousedown
|
// IE does not handle [draggable] attribute set after mousedown
|
||||||
var target = this.editor.container;
|
var target = this.editor.container;
|
||||||
|
|
@ -331,6 +329,9 @@ function DragdropHandler(mouseHandler) {
|
||||||
var button = e.getButton();
|
var button = e.getButton();
|
||||||
if (button === 0 && inSelection) {
|
if (button === 0 && inSelection) {
|
||||||
this.mousedownEvent.time = (new Date()).getTime();
|
this.mousedownEvent.time = (new Date()).getTime();
|
||||||
|
var eventTarget = e.domEvent.target || e.domEvent.srcElement;
|
||||||
|
if ("unselectable" in eventTarget)
|
||||||
|
eventTarget.unselectable = "on";
|
||||||
if (editor.getDragDelay()) {
|
if (editor.getDragDelay()) {
|
||||||
// https://code.google.com/p/chromium/issues/detail?id=286700
|
// https://code.google.com/p/chromium/issues/detail?id=286700
|
||||||
if (useragent.isWebKit) {
|
if (useragent.isWebKit) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue