diff --git a/lib/ace/css/editor.css b/lib/ace/css/editor.css index 0fe2c4dd..ba446b33 100644 --- a/lib/ace/css/editor.css +++ b/lib/ace/css/editor.css @@ -5,6 +5,7 @@ font-size: 12px; line-height: normal; color: black; + -ms-user-select: none; -moz-user-select: none; -webkit-user-select: none; user-select: none; diff --git a/lib/ace/mouse/dragdrop_handler.js b/lib/ace/mouse/dragdrop_handler.js index e3788ded..e936c917 100644 --- a/lib/ace/mouse/dragdrop_handler.js +++ b/lib/ace/mouse/dragdrop_handler.js @@ -305,8 +305,6 @@ function DragdropHandler(mouseHandler) { }; this.onMouseDrag = function(e) { - if (useragent.isOpera) - document.getSelection().removeAllRanges(); if (useragent.isIE && this.state == "dragReady") { // IE does not handle [draggable] attribute set after mousedown var target = this.editor.container; @@ -331,6 +329,9 @@ function DragdropHandler(mouseHandler) { var button = e.getButton(); if (button === 0 && inSelection) { this.mousedownEvent.time = (new Date()).getTime(); + var eventTarget = e.domEvent.target || e.domEvent.srcElement; + if ("unselectable" in eventTarget) + eventTarget.unselectable = "on"; if (editor.getDragDelay()) { // https://code.google.com/p/chromium/issues/detail?id=286700 if (useragent.isWebKit) {