Revert "Position dialogs relative to closest edge of screen."
This reverts commit 7d6566b4cbca1ca730ced0288dece3ce0071ef67.
This commit is contained in:
parent
741cee51f9
commit
bf6f9b4429
@ -255,20 +255,31 @@ UI = do ->
|
|||||||
drag = (e) ->
|
drag = (e) ->
|
||||||
{clientX, clientY} = e
|
{clientX, clientY} = e
|
||||||
|
|
||||||
x = clientX - @dx
|
left = clientX - @dx
|
||||||
y = clientY - @dy
|
left = if left < 10
|
||||||
|
0
|
||||||
left = right = top = bottom = null
|
else if @width - left < 10
|
||||||
|
null
|
||||||
if x <= @width / 2
|
|
||||||
left = if x < 10 then '0px' else x / @screenWidth * 100 + '%'
|
|
||||||
else
|
else
|
||||||
right = if @width - x < 10 then '0px' else (@width - x) / @screenWidth * 100 + '%'
|
left / @screenWidth * 100 + '%'
|
||||||
|
|
||||||
if y <= @height / 2
|
top = clientY - @dy
|
||||||
top = if y < 10 + @topBorder then @topBorder + 'px' else y / @screenHeight * 100 + '%'
|
top = if top < (10 + @topBorder)
|
||||||
|
@topBorder + 'px'
|
||||||
|
else if @height - top < (10 + @bottomBorder)
|
||||||
|
null
|
||||||
else
|
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} = @
|
||||||
style.left = left
|
style.left = left
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user