shave a line

This commit is contained in:
James Campos 2011-10-08 12:27:21 -07:00
parent 7791f77f6b
commit 338679b658
2 changed files with 3 additions and 5 deletions

View File

@ -230,8 +230,7 @@
return ui.height = d.body.clientHeight - el.offsetHeight; return ui.height = d.body.clientHeight - el.offsetHeight;
}, },
drag: function(e) { drag: function(e) {
var bottom, el, left, right, style, top; var bottom, left, right, style, top;
el = ui.el;
left = e.clientX - ui.dx; left = e.clientX - ui.dx;
if (left < 10) { if (left < 10) {
left = '0'; left = '0';
@ -246,7 +245,7 @@
top = null; top = null;
} }
bottom = top ? null : 0; bottom = top ? null : 0;
style = el.style; style = ui.el.style;
style.top = top; style.top = top;
style.right = right; style.right = right;
style.bottom = bottom; style.bottom = bottom;

View File

@ -151,7 +151,6 @@ ui =
ui.width = d.body.clientWidth - el.offsetWidth ui.width = d.body.clientWidth - el.offsetWidth
ui.height = d.body.clientHeight - el.offsetHeight ui.height = d.body.clientHeight - el.offsetHeight
drag: (e) -> drag: (e) ->
{el} = ui
left = e.clientX - ui.dx left = e.clientX - ui.dx
if left < 10 then left = '0' if left < 10 then left = '0'
else if ui.width - left < 10 then left = null else if ui.width - left < 10 then left = null
@ -162,7 +161,7 @@ ui =
bottom = if top then null else 0 bottom = if top then null else 0
#using null instead of '' is 4% faster #using null instead of '' is 4% faster
#these 4 statements are 40% faster than 1 style.cssText #these 4 statements are 40% faster than 1 style.cssText
{style} = el {style} = ui.el
style.top = top style.top = top
style.right = right style.right = right
style.bottom = bottom style.bottom = bottom