From d563e8ba3a356db63a502390a35c073243c0f45d Mon Sep 17 00:00:00 2001 From: Kalekki Date: Sun, 20 Nov 2022 18:24:17 +0200 Subject: [PATCH] make draggable class for possible future re-use --- css/index.css | 3 +++ index.html | 2 +- js/settingsbar.js | 5 ++++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/css/index.css b/css/index.css index 4844a7d..bd2f317 100644 --- a/css/index.css +++ b/css/index.css @@ -55,6 +55,9 @@ z-index: 999; } +#draggable{ + cursor:move +} #DraggableTitleBar { z-index: 999; diff --git a/index.html b/index.html index 4351693..2c7922f 100644 --- a/index.html +++ b/index.html @@ -10,7 +10,7 @@
-
openOutpaint 🐠
+
openOutpaint 🐠
diff --git a/js/settingsbar.js b/js/settingsbar.js index 9531643..e50228e 100644 --- a/js/settingsbar.js +++ b/js/settingsbar.js @@ -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();