Force spinners to be centered in their enclosing elements

This should fix the weird positioning spinners had when they were
created while hidden.

(imported from commit 777d5c376a3f93b0b7b3b749877070b438b7c102)
This commit is contained in:
Zev Benjamin 2013-01-24 15:28:07 -05:00
parent a58fecfdeb
commit 2be4a612ff

View File

@ -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) {