diff --git a/frontend/src/components/PersistentWindow.vue b/frontend/src/components/PersistentWindow.vue index 2b9356ad..13ee2220 100644 --- a/frontend/src/components/PersistentWindow.vue +++ b/frontend/src/components/PersistentWindow.vue @@ -60,16 +60,77 @@ close - + +
+ +
{ com.windowCheck = !com.windowCheck; }); @@ -188,69 +248,6 @@ export default { ); return pmidlist; }, - dragElement(elmnt) { - var pos1 = 0, - pos2 = 0, - pos3 = 0, - pos4 = 0; - if (document.getElementById(elmnt.id + "_header")) { - // if present, the header is where you move the DIV from: - document.getElementById(elmnt.id + "_header").onmousedown = - dragMouseDown; - } else { - // otherwise, move the DIV from anywhere inside the DIV: - elmnt.onmousedown = dragMouseDown; - } - - function dragMouseDown(e) { - e = e || window.event; - e.preventDefault(); - // get the mouse cursor position at startup: - pos3 = e.clientX; - pos4 = e.clientY; - document.onmouseup = closeDragElement; - // call a function whenever the cursor moves: - document.onmousemove = elementDrag; - } - function elementDrag(e) { - e = e || window.event; - e.preventDefault(); - - // calculate the conditions: - var parentWidth = window.innerWidth; - var parentHeight = window.innerHeight; - var elementWidth = elmnt.offsetWidth; - var elementHeight = elmnt.offsetHeight; - - // calculate the new coordinates: - pos1 = pos3 - e.clientX; - pos2 = pos4 - e.clientY; - pos3 = e.clientX; - pos4 = e.clientY; - - // Calculate the new coordinates for top and left - var newTop = elmnt.offsetTop - pos2; - var newLeft = elmnt.offsetLeft - pos1; - - // ensure the element stays within bounds: - if (newTop < 0) newTop = 0; - if (newLeft < 0) newLeft = 0; - if (newTop + elementHeight > parentHeight) - newTop = parentHeight - elementHeight; - if (newLeft + elementWidth > parentWidth) - newLeft = parentWidth - elementWidth; - - // set the element's new position: - elmnt.style.top = newTop + "px"; - elmnt.style.left = newLeft + "px"; - } - - function closeDragElement() { - // stop moving when mouse button is released: - document.onmouseup = null; - document.onmousemove = null; - } - }, sendMessage() { const inputDiv = this.$refs.editableDiv; const userInput = inputDiv.innerText.trim(); @@ -267,7 +264,6 @@ export default { inputDiv.innerText = ""; } }, - getAnswer(message) { let com = this; let formData = new FormData(); @@ -305,164 +301,6 @@ export default { abort_chatbot() { this.sourceToken.cancel("Request canceled"); }, - closeWindow() { - this.windowCheck = false; - }, }, }; - - - + \ No newline at end of file