diff --git a/public/styles/style.css b/public/styles/style.css index 8186c459..d765338e 100644 --- a/public/styles/style.css +++ b/public/styles/style.css @@ -527,6 +527,7 @@ body { color: #FFF; border-radius: 5px 5px 0 0; margin-bottom: 6px; + cursor: move; } #id_dialogclose { diff --git a/views/default.handlebars b/views/default.handlebars index 1545c756..b237cc24 100644 --- a/views/default.handlebars +++ b/views/default.handlebars @@ -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; + } + } + \ No newline at end of file