mirror of
https://github.com/icecoder/ICEcoder.git
synced 2026-03-09 18:16:48 +01:00
Set cursor when over miniMapBox
This commit is contained in:
@@ -351,7 +351,7 @@ $t = $text['index'];
|
||||
</div>
|
||||
|
||||
<div class="docExplorer" id="docExplorer">
|
||||
<div class="miniMap" id="miniMap"><div class="miniMapContainer" id="miniMapContainer"></div><div class="miniMapContent" id="miniMapContent" onmousedown="ICEcoder.mouseDownMinimap = true; ICEcoder.jumpMinimapPositon(event)" onmousemove="ICEcoder.jumpMinimapPositon(event)" onmouseup="ICEcoder.mouseDownMinimap = false"></div></div>
|
||||
<div class="miniMap" id="miniMap" onmousedown="document.body.style.cursor='pointer'"><div class="miniMapContainer" id="miniMapContainer"></div><div class="miniMapContent" id="miniMapContent" onmousedown="ICEcoder.mouseDownMinimap = true; ICEcoder.jumpMinimapPositon(event.y, event.buttons)" onmousemove="ICEcoder.jumpMinimapPositon(event.y, event.buttons)" onmouseup="ICEcoder.mouseDownMinimap = false"></div></div>
|
||||
<div class="functionClassList" id="functionClassList"></div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1496,6 +1496,9 @@ var ICEcoder = {
|
||||
|
||||
this.setMinimapLayout(cM);
|
||||
|
||||
ICEcoder.mouseDownMinimap = true;
|
||||
this.jumpMinimapPositon(400, 0);
|
||||
|
||||
get('docExplorer').style.right = "-220px";
|
||||
}
|
||||
},
|
||||
@@ -1534,13 +1537,13 @@ var ICEcoder = {
|
||||
}
|
||||
},
|
||||
|
||||
jumpMinimapPositon: function(e) {
|
||||
jumpMinimapPositon: function(yPos, buttons) {
|
||||
var cM, mmPosY;
|
||||
|
||||
if (ICEcoder.mouseDownMinimap) {
|
||||
cM = this.getcMInstance();
|
||||
// Set mid height position
|
||||
mmPosY = e.y - get('miniMapContainer').getBoundingClientRect().top - (get('miniMapBox').getBoundingClientRect().height / 2);
|
||||
mmPosY = yPos - get('miniMapContainer').getBoundingClientRect().top - (get('miniMapBox').getBoundingClientRect().height / 2);
|
||||
// Unless it would be beyond bottom, if so, set to bottom
|
||||
if (mmPosY > get('miniMapContainer').getBoundingClientRect().height - get('miniMapBox').getBoundingClientRect().height) {
|
||||
mmPosY = get('miniMapContainer').getBoundingClientRect().height - get('miniMapBox').getBoundingClientRect().height;
|
||||
@@ -1560,7 +1563,7 @@ var ICEcoder = {
|
||||
cM.scrollTo(0, yPos); // this.position.y
|
||||
}
|
||||
// If mouse buttons up, we no longer have mouse down on minimap
|
||||
if (e.buttons === 0) {
|
||||
if (buttons === 0) {
|
||||
ICEcoder.mouseDownMinimap = false;
|
||||
}
|
||||
},
|
||||
@@ -2888,6 +2891,16 @@ var ICEcoder = {
|
||||
}
|
||||
this.dragCursorTest();
|
||||
if (this.mouseY>62) {this.setTabWidths();};
|
||||
|
||||
if (get("miniMapBox")) {
|
||||
var mmBoxBCR = get("miniMapBox").getBoundingClientRect();
|
||||
if (
|
||||
mmBoxBCR.left <= this.mouseX && mmBoxBCR.top <= this.mouseY &&
|
||||
mmBoxBCR.right >= this.mouseX && mmBoxBCR.bottom >= this.mouseY
|
||||
) {
|
||||
document.body.style.cursor = "pointer";
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// Test if we need to show a drag cursor or not
|
||||
|
||||
Reference in New Issue
Block a user