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 = {
dialog: function(id, position, html) {
var el, left, top, _ref;
ui.el = el = document.createElement('div');
el = document.createElement('div');
el.className = 'reply dialog';
el.innerHTML = html;
el.id = id;
@ -174,7 +174,7 @@
},
move: function(e) {
var el, rect;
el = ui.el;
ui.el = el = e.target.parentNode;
rect = el.getBoundingClientRect();
ui.dx = e.clientX - rect.left;
ui.dy = e.clientY - rect.top;

View File

@ -53,7 +53,7 @@ if typeof GM_deleteValue is 'undefined'
ui =
dialog: (id, position, html) ->
ui.el = el = document.createElement 'div'
el = document.createElement 'div'
el.className = 'reply dialog'
el.innerHTML = html
el.id = id
@ -85,7 +85,7 @@ ui =
(-> el.parentNode.removeChild(el)), true
el
move: (e) ->
{el} = ui
ui.el = el = e.target.parentNode
#distance from pointer to el edge is constant; calculate it here.
# XXX opera reports el.offsetLeft / el.offsetTop as 0
rect = el.getBoundingClientRect()