Restore the time-travel functionality with Waseem's UI.

This restores the time-travel functionality and fixes Waseem's laundry
list of problems with its original UI.

(imported from commit e30e02c25af994435adb815d26284b3669c945a4)
This commit is contained in:
Tim Abbott
2012-11-27 16:30:47 -05:00
parent 44235e8e7e
commit aba2192ec2
8 changed files with 51 additions and 20 deletions

View File

@@ -638,11 +638,15 @@ function get_updates(options) {
});
}
function load_old_messages(anchor, num_before, num_after, cont, because_button) {
function load_old_messages(anchor, num_before, num_after, cont, because_button,
cont_will_add_messages) {
var narrow_str;
if (because_button === undefined) {
because_button = false;
}
if (cont_will_add_messages === undefined) {
cont_will_add_messages = false;
}
if (because_button && narrow.active()) {
narrow_str = JSON.stringify(narrow.data());
} else {
@@ -667,7 +671,7 @@ function load_old_messages(anchor, num_before, num_after, cont, because_button)
$('#connection-error').hide();
if (data.messages.length !== 0) {
if (data.messages.length !== 0 && !cont_will_add_messages) {
var add_to_home = !narrow.active() || !because_button;
add_messages(data.messages, add_to_home);
}