diff --git a/zephyr/static/js/util.js b/zephyr/static/js/util.js index 8f59321605..f9bdbc3527 100644 --- a/zephyr/static/js/util.js +++ b/zephyr/static/js/util.js @@ -43,6 +43,14 @@ exports.make_loading_indicator = function (container, text) { shadow: false }).spin(spinner_elem[0]); container.data("spinner_obj", spinner); + + // Make the spinner appear in the center of its enclosing + // element. spinner.el is a 0x0 div. The parts of the spinner + // are arranged so that they're centered on the upper-left corner + // of spinner.el. So, by setting spinner.el's position to + // relative and top/left to 50%, the center of the spinner will + // be located at the center of spinner_elem. + $(spinner.el).css({left: '50%', top: '50%'}); }; exports.destroy_loading_indicator = function (container) {