This commit is contained in:
Vanessa 2024-11-15 22:29:31 +08:00
parent cd9c4c7bfc
commit 7b342fc004
3 changed files with 20 additions and 20 deletions

View file

@ -817,13 +817,13 @@ export class Dock {
activesElement.forEach((item) => {
if (this.position === "Left" || this.position === "Right") {
if (item.getAttribute("data-index") === "1" && activesElement.length > 1) {
const dockElement = (this.data[item.getAttribute("data-type") as TDock] as Model).parent.parent.element
const dockElement = (this.data[item.getAttribute("data-type") as TDock] as Model).parent.parent.element;
item.setAttribute("data-height", dockElement.style.height ? dockElement.clientHeight.toString() : "");
}
item.setAttribute("data-width", this.layout.element.clientWidth.toString());
} else {
if (item.getAttribute("data-index") === "1" && activesElement.length > 1) {
const dockElement = (this.data[item.getAttribute("data-type") as TDock] as Model).parent.parent.element
const dockElement = (this.data[item.getAttribute("data-type") as TDock] as Model).parent.parent.element;
item.setAttribute("data-width", dockElement.style.width ? dockElement.clientWidth.toString() : "");
}
item.setAttribute("data-height", this.layout.element.clientHeight.toString());

View file

@ -907,45 +907,45 @@ export const addResize = (obj: Layout | Wnd) => {
const previousElement = resizeElement.previousElementSibling as HTMLElement;
const nextElement = resizeElement.nextElementSibling as HTMLElement;
if (previousElement && nextElement) {
const bigType = ["graph", "inbox", "globalGraph", "backlink"]
let size = 232
const bigType = ["graph", "inbox", "globalGraph", "backlink"];
let size = 232;
nextElement.style.transition = "none";
previousElement.style.transition = "none";
if (resizeElement.classList.contains("layout__resize--lr")) {
if (previousElement.classList.contains("layout__dockl")) {
document.querySelectorAll("#dockLeft .dock__item--active").forEach(item => {
if (bigType.includes(item.getAttribute("data-type"))) {
size = 320
size = 320;
}
})
previousElement.style.width = size + 'px'
});
previousElement.style.width = size + "px";
window.siyuan.layout.leftDock.setSize();
} else if (nextElement.classList.contains("layout__dockr")) {
document.querySelectorAll("#dockRight .dock__item--active").forEach(item => {
if (bigType.includes(item.getAttribute("data-type"))) {
size = 320
size = 320;
}
})
nextElement.style.width = size + 'px'
});
nextElement.style.width = size + "px";
window.siyuan.layout.rightDock.setSize();
} else {
previousElement.style.width = ''
nextElement.style.width = ''
previousElement.classList.add("fn__flex-1")
nextElement.classList.add("fn__flex-1")
previousElement.style.width = "";
nextElement.style.width = "";
previousElement.classList.add("fn__flex-1");
nextElement.classList.add("fn__flex-1");
if (resizeElement.parentElement.classList.contains("layout__dockb")) {
window.siyuan.layout.bottomDock.setSize();
}
}
} else {
if (nextElement.classList.contains("layout__dockb")) {
nextElement.style.height = '232px'
nextElement.style.height = "232px";
window.siyuan.layout.bottomDock.setSize();
} else {
previousElement.style.height = ''
nextElement.style.height = ''
previousElement.classList.add("fn__flex-1")
nextElement.classList.add("fn__flex-1")
previousElement.style.height = "";
nextElement.style.height = "";
previousElement.classList.add("fn__flex-1");
nextElement.classList.add("fn__flex-1");
if (resizeElement.parentElement.classList.contains("layout__dockl")) {
window.siyuan.layout.leftDock.setSize();
} else if (resizeElement.parentElement.classList.contains("layout__dockr")) {

View file

@ -1180,7 +1180,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
// https://github.com/siyuan-note/siyuan/issues/12989
const cardElement = hasClosestByClassName(range.startContainer, "card__main", true);
if (cardElement && document.activeElement && document.activeElement.classList.contains("protyle-wysiwyg")) {
(cardElement.querySelector(".card__action:not(.fn__none) button") as HTMLElement).focus()
(cardElement.querySelector(".card__action:not(.fn__none) button") as HTMLElement).focus();
hideElements(["select"], protyle);
}
} else {