Authors Note draggable.

This commit is contained in:
RossAscends
2023-05-16 22:04:17 +09:00
parent a960e090e5
commit 0e6ae900f6
6 changed files with 147 additions and 79 deletions

View File

@@ -106,10 +106,20 @@ function waitForElement(querySelector, timeout) {
waitForElement("#expression-image", 10000).then(function () {
dragElement(document.getElementById("expression-holder"));
dragElement(document.getElementById("floatingPrompt"));
}).catch(() => {
console.log("expression holder not loaded yet");
});
waitForElement("#floatingPrompt", 10000).then(function () {
dragElement(document.getElementById("floatingPrompt"));
}).catch(() => {
console.log("floating prompt box not loaded yet");
});
// Device detection
const deviceInfo = await getDeviceInfo();
@@ -443,6 +453,7 @@ dragElement(document.getElementById("WorldInfo"));
function dragElement(elmnt) {
var pos1 = 0, pos2 = 0, pos3 = 0, pos4 = 0;
if (document.getElementById(elmnt.id + "header")) { //ex: id="sheldheader"
// if present, the header is where you move the DIV from, but this overrides everything else:
@@ -453,6 +464,7 @@ function dragElement(elmnt) {
}
function dragMouseDown(e) {
//console.log(e);
e = e || window.event;
e.preventDefault();
// get the mouse cursor position at startup: