From 58684965daf2bcb77a49e954c30452a9556c6206 Mon Sep 17 00:00:00 2001 From: Zev Benjamin Date: Tue, 6 Nov 2012 13:18:52 -0500 Subject: [PATCH] Don't show the 'load more' button when the user has no messages (imported from commit f763535480e5efcf0d345f22e076a97ba1f5809c) --- zephyr/static/js/zephyr.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/zephyr/static/js/zephyr.js b/zephyr/static/js/zephyr.js index 3c6ac465ab..182f1c7c81 100644 --- a/zephyr/static/js/zephyr.js +++ b/zephyr/static/js/zephyr.js @@ -433,8 +433,6 @@ function add_messages(messages, where) { loading_spinner.stop(); $('#loading_indicator').hide(); loading_spinner = undefined; - - $('#load_more').show(); } messages = $.grep(messages, function (elem, idx) { @@ -615,7 +613,13 @@ $(function () { } if (have_initial_messages) { - load_old_messages(initial_pointer, "around", 400, load_more); + load_old_messages(initial_pointer, "around", 400, + function (messages) { + // TODO: We can't tell after the initial load + // whether we need the "load more" button or not. + $('#load_more').show(); + load_more(messages); + }); } else { get_updates(); }