...
|
...
|
@@ -17,10 +17,6 @@ var cmEntity = socketConf.conversationMessage; |
|
|
|
|
|
const chatBox = $('#chat-window');
|
|
|
|
|
|
const append = (html) => {
|
|
|
chatBox.append(html);
|
|
|
};
|
|
|
|
|
|
|
|
|
// 聊天调整footer位置
|
|
|
const resizeFooter = () => {
|
...
|
...
|
@@ -91,7 +87,7 @@ var chat = { |
|
|
|
|
|
self.fetchHistoryMsg().always(function() {
|
|
|
self.$chatWin.append(time(Date.now()).show());
|
|
|
self.bootSocket();
|
|
|
self.whenConnect();
|
|
|
|
|
|
if (msgHistory.curCount < msgHistory.totalCount) { // has more history
|
|
|
self.$historyLoader
|
...
|
...
|
@@ -212,6 +208,7 @@ var chat = { |
|
|
|
|
|
window.addEventListener('online', function() {
|
|
|
self._networkSick(false);
|
|
|
self.whenConnect();
|
|
|
});
|
|
|
|
|
|
window.addEventListener('offline', function() {
|
...
|
...
|
@@ -221,6 +218,21 @@ var chat = { |
|
|
},
|
|
|
|
|
|
/**
|
|
|
* 当连接时
|
|
|
*/
|
|
|
whenConnect() {
|
|
|
cmEntity.type = 1;
|
|
|
this.bootSocket();
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
* 当断开时
|
|
|
*/
|
|
|
whenDisconnect() {
|
|
|
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
* method: 在聊天窗口上, 画出信息
|
|
|
* @param object msg
|
|
|
* {
|
...
|
...
|
|