From c1bd8d821f145ae30a75727b6503ac453be79217 Mon Sep 17 00:00:00 2001 From: Zev Benjamin Date: Thu, 24 Jan 2013 17:01:15 -0500 Subject: [PATCH] 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) --- zephyr/static/js/util.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/zephyr/static/js/util.js b/zephyr/static/js/util.js index f9bdbc3527..7751983d8d 100644 --- a/zephyr/static/js/util.js +++ b/zephyr/static/js/util.js @@ -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,