Fix issues
This commit is contained in:
parent
99cdb62928
commit
b774357807
11 changed files with 35 additions and 60 deletions
|
|
@ -93,14 +93,20 @@ const toggleSettings = () => {
|
|||
};
|
||||
|
||||
const applyServerContainerShadows = () => {
|
||||
const topShadow = 'inset 0 -8px 8px -8px rgba(0, 0, 0, 0.4)';
|
||||
const bottomShadow = 'inset 0 8px 8px -8px rgba(0, 0, 0, 0.4)';
|
||||
|
||||
const { scrollHeight, clientHeight, scrollTop } = serverContainer;
|
||||
if (scrollHeight > clientHeight) {
|
||||
serverContainer.className = 'scroll';
|
||||
if (scrollTop === 0) {
|
||||
serverContainer.className += ' top';
|
||||
} else if (scrollTop + clientHeight === scrollHeight) {
|
||||
serverContainer.className += ' bottom';
|
||||
if (scrollTop <= 0) {
|
||||
serverContainer.style.boxShadow = topShadow;
|
||||
} else if (scrollTop + clientHeight >= scrollHeight) {
|
||||
serverContainer.style.boxShadow = bottomShadow;
|
||||
} else {
|
||||
serverContainer.style.boxShadow = topShadow + ',' + bottomShadow;
|
||||
}
|
||||
} else {
|
||||
serverContainer.style.boxShadow = '';
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue