diff --git a/lib/ace/css/editor.css b/lib/ace/css/editor.css index 89141ec2..0fe2c4dd 100644 --- a/lib/ace/css/editor.css +++ b/lib/ace/css/editor.css @@ -16,7 +16,6 @@ top: 0; bottom: 0; background-color: inherit; - z-index: 8; } .ace_content { @@ -27,12 +26,12 @@ cursor: text; } -.ace_content[draggable="true"] { - cursor: default; +.ace_dragging, .ace_dragging * { + cursor: default !important; } -.ace_selecting, .ace_selecting .ace_gutter{ - cursor: text; +.ace_selecting, .ace_selecting * { + cursor: text !important; } .ace_gutter { diff --git a/lib/ace/mouse/dragdrop_handler.js b/lib/ace/mouse/dragdrop_handler.js index 28d038b5..0bbc442f 100644 --- a/lib/ace/mouse/dragdrop_handler.js +++ b/lib/ace/mouse/dragdrop_handler.js @@ -54,10 +54,10 @@ function DragdropHandler(mouseHandler) { exports.forEach(function(x) { mouseHandler[x] = this[x]; }, this); - - var mouseTarget = editor.renderer.getMouseEventTarget(); editor.addEventListener("mousedown", this.onMouseDown.bind(mouseHandler)); + + var mouseTarget = editor.container; var dragSelectionMarker, x, y; var timerId, range; var dragCursor, counter = 0; @@ -99,6 +99,7 @@ function DragdropHandler(mouseHandler) { editor.session.remove(editor.getSelectionRange()); editor.renderer.$cursorLayer.setBlinking(true); } + this.editor.unsetStyle("ace_dragging"); }; this.onDragEnter = function(e) { @@ -218,7 +219,6 @@ function DragdropHandler(mouseHandler) { timerId = setInterval(onDragInterval, 20); counter = 0; event.addListener(document, "mousemove", onMouseMove); - editor.setStyle("ace_dragging"); } function clearDragMarker() { @@ -231,7 +231,6 @@ function DragdropHandler(mouseHandler) { range = null; counter = 0; event.removeListener(document, "mousemove", onMouseMove); - editor.unsetStyle("ace_dragging"); } // sometimes other code on the page can stop dragleave event leaving editor stuck in the drag state @@ -295,10 +294,11 @@ function DragdropHandler(mouseHandler) { }; this.startDrag = function(){ - var target = this.editor.renderer.getMouseEventTarget(); + var target = this.editor.container; this.setState("dragReady"); this.editor.renderer.$cursorLayer.setBlinking(false); target.draggable = true; + this.editor.setStyle("ace_dragging"); if (useragent.isIE) { // IE does not handle [draggable] attribute set after mousedown event.addListener(target, "mousemove", forceDragIE); @@ -306,8 +306,9 @@ function DragdropHandler(mouseHandler) { }; this.dragReadyEnd = function(e) { - var target = this.editor.renderer.getMouseEventTarget(); + var target = this.editor.container; target.draggable = false; + this.editor.unsetStyle("ace_dragging"); if (useragent.isIE) { event.removeListener(target, "mousemove", forceDragIE); } @@ -331,7 +332,7 @@ function DragdropHandler(mouseHandler) { if (useragent.isWebKit) { var self = this; self.cancelDrag = true; - var mouseTarget = editor.renderer.getMouseEventTarget(); + var mouseTarget = editor.container; mouseTarget.draggable = true; setTimeout(function(){ self.cancelDrag = false;