This commit is contained in:
parent
a04f7107fd
commit
a8fc5a62f9
1 changed files with 7 additions and 4 deletions
|
@ -38,10 +38,13 @@ export class Dialog {
|
|||
if (!isMobile() && options.positionId) {
|
||||
const dialogPosition = window.siyuan.storage[Constants.LOCAL_DIALOGPOSITION][options.positionId];
|
||||
if (dialogPosition) {
|
||||
left = dialogPosition.left + "px";
|
||||
top = dialogPosition.top + "px";
|
||||
options.width = dialogPosition.width + "px";
|
||||
options.height = dialogPosition.height + "px";
|
||||
if (dialogPosition.left + dialogPosition.width <= window.innerWidth &&
|
||||
dialogPosition.top + dialogPosition.height <= window.innerHeight) {
|
||||
left = dialogPosition.left + "px";
|
||||
top = dialogPosition.top + "px";
|
||||
options.width = dialogPosition.width + "px";
|
||||
options.height = dialogPosition.height + "px";
|
||||
}
|
||||
}
|
||||
}
|
||||
this.element.innerHTML = `<div class="b3-dialog" style="z-index: ${++window.siyuan.zIndex};${typeof left === "string" ? "display:block" : ""}">
|
||||
|
|
Loading…
Add table
Reference in a new issue