Tweaks to getMouseXY & dragCursorTest

Now passing through the area the function was triggered from
If it's not the top strip, add on 40+50 px
If it's the editor, add on the filesW value
This gives us an XY position across the whole of ICEcoder
Icon applied to top, content & filesFrame now
This commit is contained in:
Matt Pass
2012-07-11 13:20:10 +01:00
parent c53b0ba3ad
commit d2e5476432

View File

@@ -1130,7 +1130,7 @@ var ICEcoder = {
},
// Get the mouse position on demand
getMouseXY: function(e) {
getMouseXY: function(e,area) {
var tempX, tempY, scrollTop, IE;
IE = !e.pageX ? true : false;
@@ -1142,6 +1142,12 @@ var ICEcoder = {
top.ICEcoder.mouseX = e.pageX;
top.ICEcoder.mouseY = e.pageY;
}
if (area!="top") {
top.ICEcoder.mouseY += 40 + 50;
}
if (area=="editor") {
top.ICEcoder.mouseX += top.ICEcoder.filesW;
}
top.ICEcoder.dragCursorTest();
},
@@ -1152,10 +1158,10 @@ var ICEcoder = {
window.innerWidth ? winH = window.innerHeight : winH = document.body.clientHeight;
if (!top.ICEcoder.mouseDown) {top.ICEcoder.draggingFilesW = false};
if ((top.ICEcoder.mouseX > top.ICEcoder.filesW-7 && top.ICEcoder.mouseX < top.ICEcoder.filesW+7 && top.ICEcoder.mouseY > 40+50 && top.ICEcoder.mouseY < winH-30-40) || top.ICEcoder.draggingFilesW) {
top.document.body.style.cursor = "w-resize";
if ((top.ICEcoder.mouseX > top.ICEcoder.filesW-7 && top.ICEcoder.mouseX < top.ICEcoder.filesW+7 && top.ICEcoder.mouseY > 40 && top.ICEcoder.mouseY < (winH-30)) || top.ICEcoder.draggingFilesW) {
top.document.body.style.cursor = top.ICEcoder.content.contentWindow.document.body.style.cursor = top.ICEcoder.filesFrame.contentWindow.document.body.style.cursor = "w-resize";
} else {
top.document.body.style.cursor = "auto";
top.document.body.style.cursor = top.ICEcoder.content.contentWindow.document.body.style.cursor = top.ICEcoder.filesFrame.contentWindow.document.body.style.cursor = "auto";
}
},