From 813606ba08616f305db9e9620b7c40bbdf3fed1c Mon Sep 17 00:00:00 2001 From: James Campos Date: Wed, 30 Mar 2011 15:07:15 -0700 Subject: [PATCH] fix movement --- 4chan_x.js | 4 ++-- script.coffee | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/4chan_x.js b/4chan_x.js index 72666291d..a872b27c0 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -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; diff --git a/script.coffee b/script.coffee index 1ad3ed948..353c2e2a4 100644 --- a/script.coffee +++ b/script.coffee @@ -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()