Cause update_floating_recipient_bar to get called less frequently.

Putting update_floating_recipient_bar in the old location caused it to
be called on every single keypress, which is unnecessarily
expensive. Instead, just call it once when we think we might actually
need it: after initiating a narrow.

(imported from commit a6c1518c4001a2dde44d7b512236795da3ccd351)
This commit is contained in:
Waseem Daher
2013-01-10 14:12:39 -05:00
parent 97e8fb893b
commit 66af2da9ed
2 changed files with 4 additions and 1 deletions

View File

@@ -228,6 +228,10 @@ exports.activate = function (operators, opts) {
hashchange.save_narrow(operators); hashchange.save_narrow(operators);
$('#search_query').val(unparse(operators)); $('#search_query').val(unparse(operators));
search.update_button_visibility(); search.update_button_visibility();
// For good measure, redraw the floating recipient bar
// (if the page didn't scroll in achieving this narrow,
// it might still read the wrong thing.)
ui.update_floating_recipient_bar();
}; };
// Activate narrowing with a single operator. // Activate narrowing with a single operator.

View File

@@ -189,7 +189,6 @@ function select_message(next_message, opts) {
if (opts.then_scroll) { if (opts.then_scroll) {
recenter_view(next_message); recenter_view(next_message);
ui.update_floating_recipient_bar();
} }
return true; return true;