Skip to content

Commit

Permalink
Merge pull request #18 from Kalekki/main
Browse files Browse the repository at this point in the history
make draggable class for possible future re-use
  • Loading branch information
zero01101 authored Nov 20, 2022
2 parents cf07ef2 + c973c0a commit 369febe
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@
z-index: 999;

}
#draggable{
cursor:move
}

#DraggableTitleBar {
z-index: 999;
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
5 changes: 4 additions & 1 deletion js/settingsbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 369febe

Please sign in to comment.