Add an interim "Loading..." indicator

We will probably re-style this eventually.

Also, the animation freezes during template rendering.  And the HTML is a "give
up and use tables" situation.

(imported from commit 847374b616dc7ce909834f23d5ed9522aa457254)
This commit is contained in:
Keegan McAllister
2012-09-26 16:44:38 -04:00
parent c3943ac0c2
commit 35dcc04822
4 changed files with 27 additions and 1 deletions

View File

@@ -5,9 +5,14 @@
zephyr_json: false, initial_pointer: false, email: false,
class_list: false, instance_list: false, people_list: false */
// Compile Handlebars templates.
var loading_spinner;
var templates = {};
$(function () {
// Display loading indicator. This disappears after the first
// get_updates_longpoll completes.
loading_spinner = new Spinner().spin($('#loading_spinner')[0]);
// Compile Handlebars templates.
templates.zephyr = Handlebars.compile($("#template_zephyr").html());
templates.subscription = Handlebars.compile($("#template_subscription").html());
});
@@ -758,6 +763,12 @@ function add_zephyr_metadata(dummy, zephyr) {
function add_messages(zephyrs) {
$.each(zephyrs, add_zephyr_metadata);
if (loading_spinner) {
loading_spinner.stop();
$('#loading_indicator').hide();
loading_spinner = undefined;
}
if (narrowed)
add_to_table(zephyrs, 'zfilt', narrowed);