Debounce update_faded_messages to once per 150ms.

This is an attempt to make the compose box less sluggish.

(imported from commit b1450216da0a92fc69e0d129a74e76eca37df1b5)
This commit is contained in:
Steve Howell
2013-08-11 12:01:24 -04:00
parent 35af96a807
commit dbcbeb17d4

View File

@@ -110,7 +110,8 @@ exports.unfade_messages = function (clear_state) {
ui.update_floating_recipient_bar();
};
exports.update_faded_messages = function () {
function _update_faded_messages() {
// See also update_faded_messages(), which just wraps this with a debounce.
if (focused_recipient === undefined) {
return;
}
@@ -148,7 +149,11 @@ exports.update_faded_messages = function () {
}
ui.update_floating_recipient_bar();
};
}
// See trac #1633. For fast typists, calls to _update_faded_messages can
// cause typing sluggishness.
exports.update_faded_messages = _.debounce(_update_faded_messages, 150);
exports.update_recipient_on_narrow = function () {
if (!compose.composing()) {