diff options
author | Andy Huang <ath@google.com> | 2012-10-22 18:59:45 -0700 |
---|---|---|
committer | Andy Huang <ath@google.com> | 2012-10-22 20:16:15 -0700 |
commit | 06c0362f59437f3ea2b5832272fb66158bb4b8c0 (patch) | |
tree | 0022db3bbbeffece79d6f10f9e9f2e84e5df37b5 /assets | |
parent | dd6a7ce32c4003bd0941e2f18fcf5b80b5cd43c5 (diff) | |
download | android_packages_apps_UnifiedEmail-06c0362f59437f3ea2b5832272fb66158bb4b8c0.tar.gz android_packages_apps_UnifiedEmail-06c0362f59437f3ea2b5832272fb66158bb4b8c0.tar.bz2 android_packages_apps_UnifiedEmail-06c0362f59437f3ea2b5832272fb66158bb4b8c0.zip |
optimize re-rendering a conversation for a single outgoing message
Rather than rendering the conversation from scratch, look for
the special case of a single new message from the user that is
the last message, and just append the message HTML at the end of
the existing conversation.
To avoid stacking the new header on top of the previously last
message, do not notify ConversationContainer of dataset change
in this process. (An adapter dataset change means the container
will toss out all overlay views and immediately render given
the current spacers and adapter items. Do not want.)
The overlays for the new message will be drawn later when JS
notifies of a geometry change.
Bug: 7378693
Change-Id: Ifd2d3da8c57f685bbeae18f3d42c60821a97368c
Diffstat (limited to 'assets')
-rw-r--r-- | assets/script.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/assets/script.js b/assets/script.js index 5ced9dd11..eafeba336 100644 --- a/assets/script.js +++ b/assets/script.js @@ -426,6 +426,15 @@ function replaceMessageBodies(messageIds) { } } +// handle the special case of adding a single new message at the end of a conversation +function appendMessageHtml() { + var msg = document.createElement("div"); + msg.innerHTML = window.mail.getTempMessageBodies(); + msg = msg.children[0]; // toss the outer div, it was just to render innerHTML into + document.body.appendChild(msg); + processQuotedText(msg, true /* showElided */); +} + // END Java->JavaScript handlers // Do this first to ensure that the readiness signal comes through, |