fix movement
This commit is contained in:
parent
9d5447bbb2
commit
813606ba08
@ -123,7 +123,7 @@
|
|||||||
ui = {
|
ui = {
|
||||||
dialog: function(id, position, html) {
|
dialog: function(id, position, html) {
|
||||||
var el, left, top, _ref;
|
var el, left, top, _ref;
|
||||||
ui.el = el = document.createElement('div');
|
el = document.createElement('div');
|
||||||
el.className = 'reply dialog';
|
el.className = 'reply dialog';
|
||||||
el.innerHTML = html;
|
el.innerHTML = html;
|
||||||
el.id = id;
|
el.id = id;
|
||||||
@ -174,7 +174,7 @@
|
|||||||
},
|
},
|
||||||
move: function(e) {
|
move: function(e) {
|
||||||
var el, rect;
|
var el, rect;
|
||||||
el = ui.el;
|
ui.el = el = e.target.parentNode;
|
||||||
rect = el.getBoundingClientRect();
|
rect = el.getBoundingClientRect();
|
||||||
ui.dx = e.clientX - rect.left;
|
ui.dx = e.clientX - rect.left;
|
||||||
ui.dy = e.clientY - rect.top;
|
ui.dy = e.clientY - rect.top;
|
||||||
|
|||||||
@ -53,7 +53,7 @@ if typeof GM_deleteValue is 'undefined'
|
|||||||
|
|
||||||
ui =
|
ui =
|
||||||
dialog: (id, position, html) ->
|
dialog: (id, position, html) ->
|
||||||
ui.el = el = document.createElement 'div'
|
el = document.createElement 'div'
|
||||||
el.className = 'reply dialog'
|
el.className = 'reply dialog'
|
||||||
el.innerHTML = html
|
el.innerHTML = html
|
||||||
el.id = id
|
el.id = id
|
||||||
@ -85,7 +85,7 @@ ui =
|
|||||||
(-> el.parentNode.removeChild(el)), true
|
(-> el.parentNode.removeChild(el)), true
|
||||||
el
|
el
|
||||||
move: (e) ->
|
move: (e) ->
|
||||||
{el} = ui
|
ui.el = el = e.target.parentNode
|
||||||
#distance from pointer to el edge is constant; calculate it here.
|
#distance from pointer to el edge is constant; calculate it here.
|
||||||
# XXX opera reports el.offsetLeft / el.offsetTop as 0
|
# XXX opera reports el.offsetLeft / el.offsetTop as 0
|
||||||
rect = el.getBoundingClientRect()
|
rect = el.getBoundingClientRect()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user