fix: 退出全屏按钮适配导航 (#1541)
Reviewed-on: daoyoucloud/tachybase#1541 Reviewed-by: sealday <zhanglin@daoyoucloud.com> Co-authored-by: wjh <wwwjh0710@163.com> Co-committed-by: wjh <wwwjh0710@163.com>
This commit is contained in:
parent
26c53003e7
commit
7cd0a044c5
@ -98,6 +98,8 @@ const checkedAutoPage = (position, message, t) => {
|
||||
if (!sibling.classList.contains('autoPage')) {
|
||||
const element = document.elementFromPoint(position?.x, position?.y);
|
||||
const blockElement = element.closest('.ant-card');
|
||||
const navbar = document.querySelector('.ant-layout-header');
|
||||
const navbarHeight = navbar.getBoundingClientRect();
|
||||
if (blockElement) {
|
||||
//需要展示的区块
|
||||
const copyBlockElement = blockElement.cloneNode(true);
|
||||
@ -107,17 +109,17 @@ const checkedAutoPage = (position, message, t) => {
|
||||
copyBlockElement.style.backgroundColor = '#ffffff';
|
||||
|
||||
const autoNode = document.createElement('div');
|
||||
autoNode.style.marginTop = '2.5%';
|
||||
autoNode.style.marginTop = `${navbarHeight.height}px`;
|
||||
autoNode.style.width = '100%';
|
||||
autoNode.className = 'autoPage';
|
||||
//退出按钮
|
||||
const exitNode = document.createElement('div');
|
||||
exitNode.style.width = '100%';
|
||||
exitNode.style.height = '3vh';
|
||||
exitNode.style.height = '4vh';
|
||||
exitNode.style.textAlign = 'center';
|
||||
exitNode.style.lineHeight = '3vh';
|
||||
exitNode.style.lineHeight = '4vh';
|
||||
exitNode.style.backgroundColor = '#e6e6e6';
|
||||
exitNode.textContent = '退出全屏';
|
||||
exitNode.textContent = `${t('Exit Full Screen')}`;
|
||||
autoNode.appendChild(exitNode);
|
||||
autoNode.appendChild(copyBlockElement);
|
||||
autoNode.addEventListener('click', () => {
|
||||
|
@ -956,5 +956,6 @@
|
||||
"Disable Right Menu":"禁用右键菜单",
|
||||
"Full Screen":"切换全屏",
|
||||
"Designer Mode":"设计者模式",
|
||||
"There are no full screen blocks available at the current location":"当前位置没有可全屏区块"
|
||||
"There are no full screen blocks available at the current location":"当前位置没有可全屏区块",
|
||||
"Exit Full Screen":"退出全屏"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user