Merge branch 'release/wap-im' of http://git.yoho.cn/fe/yohobuywap-node into release/wap-im
Showing
1 changed file
with
6 additions
and
1 deletions
@@ -696,7 +696,8 @@ var chat = { | @@ -696,7 +696,8 @@ var chat = { | ||
696 | 696 | ||
697 | 697 | ||
698 | // records.reverse(); | 698 | // records.reverse(); |
699 | - | 699 | + let oldFister = self.$chatWin.find('.msg-wrap:first')[0]; |
700 | + let grap = oldFister ? oldFister.offsetTop : 0 ; | ||
700 | let $docFragment = $(document.createDocumentFragment()); | 701 | let $docFragment = $(document.createDocumentFragment()); |
701 | 702 | ||
702 | records.forEach((chatMessage, index, arr) => { | 703 | records.forEach((chatMessage, index, arr) => { |
@@ -727,6 +728,10 @@ var chat = { | @@ -727,6 +728,10 @@ var chat = { | ||
727 | 728 | ||
728 | self.$historyLoader.after($docFragment); | 729 | self.$historyLoader.after($docFragment); |
729 | 730 | ||
731 | + oldFister && self.$chatWin.scrollTop(oldFister.offsetTop - grap ); | ||
732 | + | ||
733 | + | ||
734 | + | ||
730 | 735 | ||
731 | if (records.length) { | 736 | if (records.length) { |
732 | msgHistory.endTime = records[records.length - 1].sendTime; | 737 | msgHistory.endTime = records[records.length - 1].sendTime; |
-
Please register or login to post a comment