forked from bergwhite/nodejs-chat
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
publish v3.0.4 refix a bug with roomList
- Loading branch information
Showing
5 changed files
with
20 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
.box-list-wrap { | ||
font-size: @fontTitle; | ||
overflow-y: scroll; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,18 @@ | ||
const roomListDOM = document.getElementsByClassName('box-list-wrap')[0] | ||
(() => { | ||
const roomListDOM = document.getElementsByClassName('box-list-wrap')[0] | ||
const topTitleDOM = document.getElementsByClassName('top-title')[0] | ||
|
||
// 通过计算获取聊天框的合适高度 | ||
function changeRoomListHeight() { | ||
const documentHeight = document.documentElement.clientHeight | ||
const topTitleDOMHeight = topTitleDOM.offsetHeight | ||
const roomListDOMHeight = documentHeight - topTitleDOMHeight | ||
roomListDOM.style.height = `${roomListDOMHeight}px` | ||
} | ||
// 通过计算获取房间列表的合适高度 | ||
function changeRoomListHeight() { | ||
const documentHeight = document.documentElement.clientHeight | ||
const topTitleDOMHeight = topTitleDOM.offsetHeight | ||
const roomListDOMHeight = documentHeight - topTitleDOMHeight | ||
roomListDOM.style.height = `${roomListDOMHeight}px` | ||
} | ||
|
||
document.body.onload = () => changeRoomListHeight() | ||
// 视窗改变时重新计算高度 | ||
window.addEventListener('resize', () => changeRoomListHeight(), false) | ||
|
||
// 文档加载完成时重新计算高度 | ||
document.body.onload = () => changeRoomListHeight() | ||
})() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters