Hack around loading indicator width calculations sometimes being slightly wrong

Under some unknown circumstances (it happens on Keegan's laptop) the
loading indicator text width calculation returns a result that's a
few pixels too small.  We hack around this by setting 'white-space'
property on the container div to 'nowrap'.  The container's div will
be slightly too small (and thus the text will stick out the right
side by a few pixels), but that's probably OK.

This fixes #698

(imported from commit 2e5b28fb3a1fca78c700af74a452bfafd09a2da9)
This commit is contained in:
Zev Benjamin 2013-01-24 17:01:15 -05:00
parent 8bade19451
commit c1bd8d821f
1 changed files with 8 additions and 1 deletions

View File

@ -30,9 +30,16 @@ exports.make_loading_indicator = function (container, text) {
// These width calculations are tied to the spinner width and
// margins defined via CSS
//
// TODO: We set white-space to 'nowrap' because under some
// unknown circumstances (it happens on Keegan's laptop) the text
// width calculation, above, returns a result that's a few pixels
// too small. The container's div will be slightly too small,
// but that's probably OK for our purposes.
container.css({width: 38 + text_width,
height: 38,
display: 'block'});
display: 'block',
'white-space': 'nowrap'});
var spinner = new Spinner({
lines: 8,