Fixes in popup.js

This commit is contained in:
absurdo 2024-01-25 17:54:16 +01:00
parent dca8728315
commit 4cd11417ef

View file

@ -393,7 +393,7 @@ function dragElement(draggable, header) {
var popup=this; var popup=this;
$(header).on('mousedown', function (e) { $(popup).find(header).on('mousedown', {draggable: this}, function (e) {
e = e || window.event; e = e || window.event;
@ -402,16 +402,17 @@ function dragElement(draggable, header) {
pos3 = e.clientX; pos3 = e.clientX;
pos4 = e.clientY; pos4 = e.clientY;
document.onmouseup = closeDragElement; document.onmouseup = e.data.draggable.closeDragElement;
// call a function whenever the cursor moves: // call a function whenever the cursor moves:
document.onmousemove = elementDrag; document.onmousemove = e.data.draggable.elementDrag;
console.log('Moving... '); console.log('Moving... ');
}); });
function elementDrag(e) { //function elementDrag(e) {
this.elementDrag=function (e) {
console.log('Moving windows...'); console.log('Moving windows...');
@ -436,7 +437,8 @@ function dragElement(draggable, header) {
} }
function closeDragElement() { //function closeDragElement() {
this.closeDragElement=function (e) {
// stop moving when mouse button is released: // stop moving when mouse button is released:
document.onmouseup = null; document.onmouseup = null;
document.onmousemove = null; document.onmousemove = null;