1
0
Fork 0
mirror of https://github.com/Ylianst/MeshCentral.git synced 2025-02-12 19:11:51 +00:00

Desktop site dialog box can now move, #2841

This commit is contained in:
Ylian Saint-Hilaire 2021-07-02 14:32:22 -07:00
parent 69aa0c0d1c
commit b949fb6346
2 changed files with 33 additions and 0 deletions

View file

@ -527,6 +527,7 @@ body {
color: #FFF;
border-radius: 5px 5px 0 0;
margin-bottom: 6px;
cursor: move;
}
#id_dialogclose {

View file

@ -1584,6 +1584,9 @@
// Override the collapse button text
updateCollapseAllButton();
// Make the dialog box movable
dialogBoxDrag();
}
function refreshCookieSession() {
@ -15742,6 +15745,35 @@
if (closeDialog) { setDialogMode(0); }
}
// Make the dialog box movable
function dialogBoxDrag() {
var elmnt = Q('dialog');
var pos1 = 0, pos2 = 0, pos3 = 0, pos4 = 0;
Q('dialogHeader').onmousedown = dragMouseDown;
function dragMouseDown(e) {
e = e || window.event;
e.preventDefault();
pos3 = e.clientX;
pos4 = e.clientY;
document.onmouseup = closeDragElement;
document.onmousemove = elementDrag;
}
function elementDrag(e) {
e = e || window.event;
e.preventDefault();
pos1 = pos3 - e.clientX;
pos2 = pos4 - e.clientY;
pos3 = e.clientX;
pos4 = e.clientY;
elmnt.style.top = (elmnt.offsetTop - pos2) + 'px';
elmnt.style.left = (elmnt.offsetLeft - pos1) + 'px';
}
function closeDragElement() {
document.onmouseup = null;
document.onmousemove = null;
}
}
</script>
</body>
</html>