mirror of
https://github.com/icecoder/ICEcoder.git
synced 2026-03-08 01:26:47 +01:00
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:
14
lib/coder.js
14
lib/coder.js
@@ -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";
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user