Revert "Position dialogs relative to closest edge of screen."

This reverts commit 7d6566b4cbca1ca730ced0288dece3ce0071ef67.
This commit is contained in:
ccd0 2014-09-01 11:06:03 -07:00
parent 741cee51f9
commit bf6f9b4429

View File

@ -255,20 +255,31 @@ UI = do ->
drag = (e) ->
{clientX, clientY} = e
x = clientX - @dx
y = clientY - @dy
left = right = top = bottom = null
if x <= @width / 2
left = if x < 10 then '0px' else x / @screenWidth * 100 + '%'
left = clientX - @dx
left = if left < 10
0
else if @width - left < 10
null
else
right = if @width - x < 10 then '0px' else (@width - x) / @screenWidth * 100 + '%'
left / @screenWidth * 100 + '%'
if y <= @height / 2
top = if y < 10 + @topBorder then @topBorder + 'px' else y / @screenHeight * 100 + '%'
top = clientY - @dy
top = if top < (10 + @topBorder)
@topBorder + 'px'
else if @height - top < (10 + @bottomBorder)
null
else
bottom = if @height - y < 10 + @bottomBorder then @bottomBorder + 'px' else (@height - y) / @screenHeight * 100 + '%'
top / @screenHeight * 100 + '%'
right = if left is null
0
else
null
bottom = if top is null
@bottomBorder + 'px'
else
null
{style} = @
style.left = left