ui.dialog: rm string position aliases
This commit is contained in:
parent
484b2f4eb9
commit
71beb609d3
26
4chan_x.js
26
4chan_x.js
@ -136,31 +136,7 @@
|
||||
el.className = 'reply dialog';
|
||||
el.innerHTML = html;
|
||||
el.id = id;
|
||||
if (typeof position === 'object') {
|
||||
left = position.left, top = position.top;
|
||||
} else {
|
||||
switch (position) {
|
||||
case 'topleft':
|
||||
left = '0px';
|
||||
top = '0px';
|
||||
break;
|
||||
case 'topright':
|
||||
left = null;
|
||||
top = '0px';
|
||||
break;
|
||||
case 'bottomleft':
|
||||
left = '0px';
|
||||
top = null;
|
||||
break;
|
||||
case 'bottomright':
|
||||
left = null;
|
||||
top = null;
|
||||
break;
|
||||
case 'center':
|
||||
left = '50%';
|
||||
top = '25%';
|
||||
}
|
||||
}
|
||||
left = position.left, top = position.top;
|
||||
left = (_ref = localStorage["" + id + "Left"]) != null ? _ref : left;
|
||||
top = (_ref2 = localStorage["" + id + "Top"]) != null ? _ref2 : top;
|
||||
if (left) {
|
||||
|
||||
@ -75,25 +75,7 @@ ui =
|
||||
el.className = 'reply dialog'
|
||||
el.innerHTML = html
|
||||
el.id = id
|
||||
if typeof position is 'object'
|
||||
{left, top} = position
|
||||
else
|
||||
switch position
|
||||
when 'topleft'
|
||||
left = '0px'
|
||||
top = '0px'
|
||||
when 'topright'
|
||||
left = null
|
||||
top = '0px'
|
||||
when 'bottomleft'
|
||||
left = '0px'
|
||||
top = null
|
||||
when 'bottomright'
|
||||
left = null
|
||||
top = null
|
||||
when 'center'
|
||||
left = '50%'
|
||||
top = '25%'
|
||||
{left, top} = position
|
||||
left = localStorage["#{id}Left"] ? left
|
||||
top = localStorage["#{id}Top"] ? top
|
||||
if left then el.style.left = left else el.style.right = '0px'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user