|
|
|
@ -128,10 +128,9 @@ export class ModalManage
|
|
|
|
|
{
|
|
|
|
|
let commandHeight = document.getElementsByClassName("lm_item lm_row")[0].clientHeight;
|
|
|
|
|
this.m_ModalContainer.style.left = `calc( 50% - ${this.m_ModalContainer.clientWidth / 2}px)`;
|
|
|
|
|
this.m_ModalContainer.style.top = `calc( 50% - ${(this.m_ModalContainer.clientHeight + commandHeight - 40) / 2}px)`;
|
|
|
|
|
this.m_ModalContainer.style.top = `calc( 50% - ${(this.m_ModalContainer.clientHeight) / 2}px)`;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.m_ModalContainer.style.width = "auto";
|
|
|
|
|
this.m_ModalContainer.focus();
|
|
|
|
|
this.MoveModal();
|
|
|
|
|
}
|
|
|
|
@ -181,16 +180,11 @@ export class ModalManage
|
|
|
|
|
//鼠标在模态框的位置
|
|
|
|
|
let modalX;
|
|
|
|
|
let modalY;
|
|
|
|
|
//命令栏高度
|
|
|
|
|
let commandHeight = document.getElementsByClassName("lm_item lm_row")[0].clientHeight;
|
|
|
|
|
//底部面板高度
|
|
|
|
|
let downHeight = document.getElementById("DownPanel").offsetHeight;
|
|
|
|
|
let topHeight = 40;
|
|
|
|
|
|
|
|
|
|
dragArea.onmousedown = (e) =>
|
|
|
|
|
{
|
|
|
|
|
//底部边界
|
|
|
|
|
let maxBottom = window.innerHeight - commandHeight - modal.offsetHeight + downHeight;
|
|
|
|
|
let maxBottom = window.innerHeight - modal.offsetHeight;
|
|
|
|
|
modalX = e.clientX - modal.offsetLeft;
|
|
|
|
|
modalY = e.clientY - modal.offsetTop;
|
|
|
|
|
modal.style.cursor = "move";
|
|
|
|
@ -202,13 +196,17 @@ export class ModalManage
|
|
|
|
|
(moveX > window.innerWidth - modal.offsetWidth) moveX = window.innerWidth - modal.offsetWidth;
|
|
|
|
|
|
|
|
|
|
let moveY = e.clientY - modalY;
|
|
|
|
|
if (moveY < topHeight) moveY = topHeight;
|
|
|
|
|
|
|
|
|
|
if (moveY < 0) moveY = 0;
|
|
|
|
|
else if (moveY > maxBottom) moveY = maxBottom;
|
|
|
|
|
|
|
|
|
|
if (moveY > 0)
|
|
|
|
|
{
|
|
|
|
|
modal.style.top = moveY + "px";
|
|
|
|
|
modalY = e.clientY - modal.offsetTop;
|
|
|
|
|
}
|
|
|
|
|
modal.style.left = moveX + "px";
|
|
|
|
|
modal.style.top = moveY + "px";
|
|
|
|
|
modalX = e.clientX - modal.offsetLeft;
|
|
|
|
|
modalY = e.clientY - modal.offsetTop;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
document.onmouseup = (e) =>
|
|
|
|
|