message_edit: Clean up comments around scroll position.

This commit is contained in:
Tim Abbott 2019-06-24 22:53:57 -07:00
parent edc5337d53
commit f9aef15e72
1 changed files with 2 additions and 2 deletions

View File

@ -408,9 +408,9 @@ function edit_message(row, raw_content) {
message_edit_content.val(contents);
}
// Scroll to keep the message content in the same place
// Scroll to keep the top of the message content text in the same
// place visually, adjusting for border and padding.
var edit_top = message_edit_content[0].getBoundingClientRect().top;
/* adjust for border and padding and 1 line height*/
var scroll_by = edit_top - content_top + 5;
edit_obj.scrolled_by = scroll_by;
message_viewport.scrollTop(message_viewport.scrollTop() + scroll_by);