From 2bb0a361aacc0026f411560edf313e89b05ffc42 Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Tue, 23 Oct 2012 15:57:50 +0100 Subject: [PATCH] Clear mouseDown state if over scrollbar Clicking on scrollbar to scroll content set the mouseDown state to true This wasn't being reset on mouse up and moving mouse pointer towards the edge of the file manager enabled resizing of width Now on going beyond editor width (-scrollbar of 20px), sets mouseDown to false --- lib/ice-coder.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/ice-coder.js b/lib/ice-coder.js index 17cc484..f5edb28 100644 --- a/lib/ice-coder.js +++ b/lib/ice-coder.js @@ -1038,7 +1038,7 @@ var ICEcoder = { // Get the mouse position on demand getMouseXY: function(e,area) { - var tempX, tempY, scrollTop; + var tempX, tempY, scrollTop, winW; top.ICEcoder.mouseX = e.pageX ? e.pageX : e.clientX + document.body.scrollLeft; top.ICEcoder.mouseY = e.pageY ? e.pageY : e.clientY + document.body.scrollTop; @@ -1049,6 +1049,8 @@ var ICEcoder = { if (area=="editor") { top.ICEcoder.mouseX += top.ICEcoder.filesW; } + winW = window.innerWidth ? window.innerWidth : document.body.clientWidth; + if (top.ICEcoder.mouseX > (winW-20)) {top.ICEcoder.mouseDown=false}; top.ICEcoder.dragCursorTest(); },