mirror of
https://github.com/zulip/zulip.git
synced 2025-11-09 16:37:23 +00:00
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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user