fix movement

This commit is contained in:
James Campos 2011-03-30 15:07:15 -07:00
parent 9d5447bbb2
commit 813606ba08
2 changed files with 4 additions and 4 deletions

View File

@ -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;

View File

@ -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()