Fix quote preview overflowing in some cases, remove unnecessary stuff.

This commit is contained in:
Nicolas Stepien 2011-05-08 23:22:57 +02:00
parent 1521e0d7a3
commit c5aef27248
2 changed files with 8 additions and 8 deletions

View File

@ -232,7 +232,7 @@
height = el.offsetHeight;
top = clientY - 120;
bot = top + height;
el.style.top = ui.winHeight < height || top < 0 ? '0px' : bot > ui.winHeight ? ui.winHeight - height + 'px' : top + 'px';
el.style.top = ui.winHeight < height || top < 0 ? 0 : bot > ui.winHeight ? ui.winHeight - height : top;
return el.style.left = clientX + 45;
},
hoverend: function(e) {
@ -1714,7 +1714,8 @@
}
}
$.show(qp);
return ui.el = qp;
ui.el = qp;
return ui.winHeight = d.body.clientHeight;
},
parse: function(req, id, threadID) {
var body, html, qp, reply, _i, _len, _ref;
@ -1953,8 +1954,7 @@
el.src = this.parentNode.href;
$.show(el);
ui.el = el;
ui.winHeight = d.body.clientHeight;
return ui.winWidth = d.body.clientWidth;
return ui.winHeight = d.body.clientHeight;
}
}
};

View File

@ -150,11 +150,11 @@ ui =
bot = top + height
el.style.top =
if ui.winHeight < height or top < 0
'0px'
0
else if bot > ui.winHeight
ui.winHeight - height + 'px'
ui.winHeight - height
else
top + 'px'
top
el.style.left = clientX + 45
hoverend: (e) ->
$.hide ui.el
@ -1366,6 +1366,7 @@ quotePreview =
g.requests[threadID] = $.get @href, (-> quotePreview.parse this, id, threadID)
$.show qp
ui.el = qp
ui.winHeight = d.body.clientHeight
parse: (req, id, threadID) ->
qp = $ '#qp'
return unless qp.innerHTML is "Loading #{id}..."
@ -1516,7 +1517,6 @@ imageHover =
$.show el
ui.el = el
ui.winHeight = d.body.clientHeight
ui.winWidth = d.body.clientWidth
imgPreloading =
init: ->