fix thread watcher position

This commit is contained in:
James Campos 2011-03-12 15:52:36 -08:00
parent 88c88894d4
commit 1ef79b7bdd
2 changed files with 48 additions and 40 deletions

View File

@ -140,6 +140,9 @@
el.className = 'reply dialog'; el.className = 'reply dialog';
el.innerHTML = html; el.innerHTML = html;
el.id = id; el.id = id;
if (typeof position === 'object') {
left = position.left, top = position.top;
} else {
switch (position) { switch (position) {
case 'topleft': case 'topleft':
left = '0px'; left = '0px';
@ -161,6 +164,7 @@
left = '50%'; left = '50%';
top = '25%'; top = '25%';
} }
}
left = GM_getValue("" + id + "Left", left); left = GM_getValue("" + id + "Left", left);
top = GM_getValue("" + id + "Top", top); top = GM_getValue("" + id + "Top", top);
if (left) { if (left) {
@ -1798,8 +1802,10 @@
} }
if (getConfig('Thread Watcher')) { if (getConfig('Thread Watcher')) {
html = '<div class="move">Thread Watcher</div><div></div>'; html = '<div class="move">Thread Watcher</div><div></div>';
watcher = new Dialog('watcher', 'topleft', html).el; watcher = new Dialog('watcher', {
watcher.style.top = '50px'; top: '50px',
left: '0px'
}, html).el;
mv(watcher, d.body); mv(watcher, d.body);
watcherUpdate(); watcherUpdate();
threads = g.watched[g.BOARD] || []; threads = g.watched[g.BOARD] || [];

View File

@ -78,6 +78,9 @@ class Dialog
el.className = 'reply dialog' el.className = 'reply dialog'
el.innerHTML = html el.innerHTML = html
el.id = id el.id = id
if typeof position is 'object'
{left, top} = position
else
switch position switch position
when 'topleft' when 'topleft'
left = '0px' left = '0px'
@ -1364,8 +1367,7 @@ if getConfig 'Quick Report'
if getConfig 'Thread Watcher' if getConfig 'Thread Watcher'
#create watcher #create watcher
html = '<div class="move">Thread Watcher</div><div></div>' html = '<div class="move">Thread Watcher</div><div></div>'
watcher = new Dialog('watcher', 'topleft', html).el watcher = new Dialog('watcher', top: '50px', left: '0px', html).el
watcher.style.top = '50px' #don't cover the board links
mv watcher, d.body mv watcher, d.body
watcherUpdate() watcherUpdate()