fix movement

This commit is contained in:
James Campos 2011-04-11 02:01:06 -07:00
parent 649afadb25
commit 0a12099c92
2 changed files with 7 additions and 7 deletions

View File

@ -116,7 +116,7 @@
} }
ui = { ui = {
dialog: function(id, position, html) { dialog: function(id, position, html) {
var el, left, top, _ref; var el, left, top, _ref, _ref2, _ref3;
el = document.createElement('div'); el = document.createElement('div');
el.className = 'reply dialog'; el.className = 'reply dialog';
el.innerHTML = html; el.innerHTML = html;
@ -146,8 +146,8 @@
top = '25%'; top = '25%';
} }
} }
left = localStorage["" + id + "Left"] || left; left = (_ref = localStorage["" + id + "Left"]) != null ? _ref : left;
top = localStorage["" + id + "Top"] || top; top = (_ref2 = localStorage["" + id + "Top"]) != null ? _ref2 : top;
if (left) { if (left) {
el.style.left = left; el.style.left = left;
} else { } else {
@ -159,8 +159,8 @@
el.style.bottom = '0px'; el.style.bottom = '0px';
} }
el.querySelector('div.move').addEventListener('mousedown', ui.move, true); el.querySelector('div.move').addEventListener('mousedown', ui.move, true);
if ((_ref = el.querySelector('div.move a[name=close]')) != null) { if ((_ref3 = el.querySelector('div.move a[name=close]')) != null) {
_ref.addEventListener('click', (function() { _ref3.addEventListener('click', (function() {
return el.parentNode.removeChild(el); return el.parentNode.removeChild(el);
}), true); }), true);
} }

View File

@ -72,8 +72,8 @@ ui =
when 'center' when 'center'
left = '50%' left = '50%'
top = '25%' top = '25%'
left = localStorage["#{id}Left"] or left left = localStorage["#{id}Left"] ? left
top = localStorage["#{id}Top"] or top top = localStorage["#{id}Top"] ? top
if left then el.style.left = left else el.style.right = '0px' if left then el.style.left = left else el.style.right = '0px'
if top then el.style.top = top else el.style.bottom = '0px' if top then el.style.top = top else el.style.bottom = '0px'
el.querySelector('div.move').addEventListener 'mousedown', ui.move, true el.querySelector('div.move').addEventListener 'mousedown', ui.move, true