make draggable class for possible future re-use

This commit is contained in:
Kalekki 2022-11-20 18:24:17 +02:00 committed by Victor Seiji Hariki
parent aefd45f436
commit d563e8ba3a
3 changed files with 8 additions and 2 deletions

View file

@ -55,6 +55,9 @@
z-index: 999;
}
#draggable{
cursor:move
}
#DraggableTitleBar {
z-index: 999;

View file

@ -10,7 +10,7 @@
<body>
<div id="infoContainer">
<div id="DraggableTitleBar">openOutpaint 🐠</div>
<div id="DraggableTitleBar" class="draggable">openOutpaint 🐠</div>
<div id="info" class="info" style="min-width:200px;">
<label for="host">Host</label>

View file

@ -5,7 +5,10 @@ function dragElement(elmnt) {
p2 = 0,
p3 = 0,
p4 = 0;
document.getElementById('DraggableTitleBar').onmousedown = dragMouseDown;
var draggableElements = document.getElementsByClassName('draggable');
for (var i = 0; i < draggableElements.length; i++) {
draggableElements[i].onmousedown = dragMouseDown;
}
function dragMouseDown(e) {
e.preventDefault();