Fixes in popup.js
This commit is contained in:
parent
dca8728315
commit
4cd11417ef
1 changed files with 7 additions and 5 deletions
12
popup.js
12
popup.js
|
|
@ -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;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue