Don't try to scroll to show composebox when no messages are showing.

(imported from commit 3835c7de0f3cad777b1fd5b609e9dc71635422ac)
This commit is contained in:
Tim Abbott
2012-12-05 13:27:31 -05:00
parent 6d9e0095eb
commit 72b9f25cbd

View File

@@ -21,6 +21,11 @@ function show(tabname, focus_area) {
$('.message_comp').slideDown(100, function () { $('.message_comp').slideDown(100, function () {
// If the compose box is obscuring the currently selected message, // If the compose box is obscuring the currently selected message,
// scroll up until the message is no longer occluded. // scroll up until the message is no longer occluded.
if (selected_message_id === -1) {
// If there's no selected message, there's no need to
// scroll the compose box to avoid it.
return;
}
var cover = selected_message.offset().top + selected_message.height() var cover = selected_message.offset().top + selected_message.height()
- $("#compose").offset().top; - $("#compose").offset().top;
if (cover > 0) { if (cover > 0) {