Merge pull request #18 from Kalekki/main

make draggable class for possible future re-use
This commit is contained in:
tim h 2022-11-20 11:41:46 -06:00 committed by GitHub
commit f43d072f60
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();