From 71beb609d35457de2c7827d0720d3acf38653faf Mon Sep 17 00:00:00 2001 From: James Campos Date: Sat, 14 May 2011 10:29:12 -0700 Subject: [PATCH] ui.dialog: rm string position aliases --- 4chan_x.js | 26 +------------------------- script.coffee | 20 +------------------- 2 files changed, 2 insertions(+), 44 deletions(-) diff --git a/4chan_x.js b/4chan_x.js index 316224efb..6ca55ab67 100644 --- a/4chan_x.js +++ b/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) { diff --git a/script.coffee b/script.coffee index c2dc07cde..6b118a3bf 100644 --- a/script.coffee +++ b/script.coffee @@ -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'