mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-15 16:41:07 +08:00
🎨 数据库不能设置布局
This commit is contained in:
parent
69d8c93c98
commit
7d6f9bb0df
@ -375,7 +375,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
img.av__cellassetimg {
|
img.av__cellassetimg {
|
||||||
max-height: 24px;
|
max-height: 18px;
|
||||||
border-radius: var(--b3-border-radius);
|
border-radius: var(--b3-border-radius);
|
||||||
margin: 1px 2px;
|
margin: 1px 2px;
|
||||||
max-width: none;
|
max-width: none;
|
||||||
|
@ -710,7 +710,12 @@ export class Gutter {
|
|||||||
if (!isMobile()) {
|
if (!isMobile()) {
|
||||||
appearanceElement.lastElementChild.classList.add("b3-menu__submenu--row");
|
appearanceElement.lastElementChild.classList.add("b3-menu__submenu--row");
|
||||||
}
|
}
|
||||||
|
selectsElement.find((item) => {
|
||||||
|
if (!item.classList.contains("NodeAttributeView")) {
|
||||||
this.genAlign(selectsElement, protyle);
|
this.genAlign(selectsElement, protyle);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
this.genWidths(selectsElement, protyle);
|
this.genWidths(selectsElement, protyle);
|
||||||
window.siyuan.menus.menu.append(new MenuItem({type: "separator"}).element);
|
window.siyuan.menus.menu.append(new MenuItem({type: "separator"}).element);
|
||||||
window.siyuan.menus.menu.append(new MenuItem({
|
window.siyuan.menus.menu.append(new MenuItem({
|
||||||
@ -1510,7 +1515,9 @@ export class Gutter {
|
|||||||
if (!isMobile()) {
|
if (!isMobile()) {
|
||||||
appearanceElement.lastElementChild.classList.add("b3-menu__submenu--row");
|
appearanceElement.lastElementChild.classList.add("b3-menu__submenu--row");
|
||||||
}
|
}
|
||||||
|
if (type !== "NodeAttributeView") {
|
||||||
this.genAlign([nodeElement], protyle);
|
this.genAlign([nodeElement], protyle);
|
||||||
|
}
|
||||||
this.genWidths([nodeElement], protyle);
|
this.genWidths([nodeElement], protyle);
|
||||||
}
|
}
|
||||||
window.siyuan.menus.menu.append(new MenuItem({type: "separator"}).element);
|
window.siyuan.menus.menu.append(new MenuItem({type: "separator"}).element);
|
||||||
@ -1614,7 +1621,9 @@ export class Gutter {
|
|||||||
accelerator: window.siyuan.config.keymap.editor.general.alignLeft.custom,
|
accelerator: window.siyuan.config.keymap.editor.general.alignLeft.custom,
|
||||||
click: () => {
|
click: () => {
|
||||||
this.genClick(nodeElements, protyle, (e: HTMLElement) => {
|
this.genClick(nodeElements, protyle, (e: HTMLElement) => {
|
||||||
|
if (!e.classList.contains("NodeAttributeView")) {
|
||||||
e.style.textAlign = "left";
|
e.style.textAlign = "left";
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
@ -1623,7 +1632,9 @@ export class Gutter {
|
|||||||
accelerator: window.siyuan.config.keymap.editor.general.alignCenter.custom,
|
accelerator: window.siyuan.config.keymap.editor.general.alignCenter.custom,
|
||||||
click: () => {
|
click: () => {
|
||||||
this.genClick(nodeElements, protyle, (e: HTMLElement) => {
|
this.genClick(nodeElements, protyle, (e: HTMLElement) => {
|
||||||
|
if (!e.classList.contains("NodeAttributeView")) {
|
||||||
e.style.textAlign = "center";
|
e.style.textAlign = "center";
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
@ -1632,7 +1643,9 @@ export class Gutter {
|
|||||||
accelerator: window.siyuan.config.keymap.editor.general.alignRight.custom,
|
accelerator: window.siyuan.config.keymap.editor.general.alignRight.custom,
|
||||||
click: () => {
|
click: () => {
|
||||||
this.genClick(nodeElements, protyle, (e: HTMLElement) => {
|
this.genClick(nodeElements, protyle, (e: HTMLElement) => {
|
||||||
|
if (!e.classList.contains("NodeAttributeView")) {
|
||||||
e.style.textAlign = "right";
|
e.style.textAlign = "right";
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
@ -1640,7 +1653,9 @@ export class Gutter {
|
|||||||
icon: "iconMenu",
|
icon: "iconMenu",
|
||||||
click: () => {
|
click: () => {
|
||||||
this.genClick(nodeElements, protyle, (e: HTMLElement) => {
|
this.genClick(nodeElements, protyle, (e: HTMLElement) => {
|
||||||
|
if (!e.classList.contains("NodeAttributeView")) {
|
||||||
e.style.textAlign = "justify";
|
e.style.textAlign = "justify";
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
@ -1650,7 +1665,9 @@ export class Gutter {
|
|||||||
icon: "iconLtr",
|
icon: "iconLtr",
|
||||||
click: () => {
|
click: () => {
|
||||||
this.genClick(nodeElements, protyle, (e: HTMLElement) => {
|
this.genClick(nodeElements, protyle, (e: HTMLElement) => {
|
||||||
|
if (!e.classList.contains("NodeAttributeView")) {
|
||||||
e.style.direction = "ltr";
|
e.style.direction = "ltr";
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
@ -1658,7 +1675,9 @@ export class Gutter {
|
|||||||
icon: "iconRtl",
|
icon: "iconRtl",
|
||||||
click: () => {
|
click: () => {
|
||||||
this.genClick(nodeElements, protyle, (e: HTMLElement) => {
|
this.genClick(nodeElements, protyle, (e: HTMLElement) => {
|
||||||
|
if (!e.classList.contains("NodeAttributeView")) {
|
||||||
e.style.direction = "rtl";
|
e.style.direction = "rtl";
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
|
@ -29,7 +29,7 @@ export const avRender = (element: Element, protyle: IProtyle, cb?: () => void) =
|
|||||||
let html = "";
|
let html = "";
|
||||||
[1, 2, 3].forEach(() => {
|
[1, 2, 3].forEach(() => {
|
||||||
html += `<div class="av__row">
|
html += `<div class="av__row">
|
||||||
<div style="width: 24px"></div>
|
<div style="width: 24px;flex-shrink: 0"></div>
|
||||||
<div class="av__cell" style="width: 200px"><span class="av__pulse"></span></div>
|
<div class="av__cell" style="width: 200px"><span class="av__pulse"></span></div>
|
||||||
<div class="av__cell" style="width: 200px"><span class="av__pulse"></span></div>
|
<div class="av__cell" style="width: 200px"><span class="av__pulse"></span></div>
|
||||||
<div class="av__cell" style="width: 200px"><span class="av__pulse"></span></div>
|
<div class="av__cell" style="width: 200px"><span class="av__pulse"></span></div>
|
||||||
@ -169,8 +169,9 @@ ${cell.color ? `color:${cell.color};` : ""}">${text}</div>`;
|
|||||||
<span class="item__text">${item.name}</span>
|
<span class="item__text">${item.name}</span>
|
||||||
</div>`;
|
</div>`;
|
||||||
});
|
});
|
||||||
const paddingLeft = e.parentElement.style.paddingLeft;
|
const setWidth = e.style.width.endsWith("%");
|
||||||
const paddingRight = e.parentElement.style.paddingRight;
|
const paddingLeft = setWidth ? "" : e.parentElement.style.paddingLeft;
|
||||||
|
const paddingRight = setWidth ? "" : e.parentElement.style.paddingRight;
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
e.firstElementChild.outerHTML = `<div>
|
e.firstElementChild.outerHTML = `<div>
|
||||||
<div class="av__header" style="padding-left: ${paddingLeft};padding-right: ${paddingRight};">
|
<div class="av__header" style="padding-left: ${paddingLeft};padding-right: ${paddingRight};">
|
||||||
@ -205,9 +206,14 @@ ${cell.color ? `color:${cell.color};` : ""}">${text}</div>`;
|
|||||||
</div>
|
</div>
|
||||||
</div>`;
|
</div>`;
|
||||||
if (e.parentElement.clientWidth > 0) {
|
if (e.parentElement.clientWidth > 0) {
|
||||||
e.style.width = e.parentElement.clientWidth + "px";
|
e.style.maxWidth = e.parentElement.clientWidth + "px";
|
||||||
}
|
}
|
||||||
|
if (setWidth) {
|
||||||
|
e.style.alignSelf = "";
|
||||||
|
} else {
|
||||||
|
e.style.width = "";
|
||||||
e.style.alignSelf = "center";
|
e.style.alignSelf = "center";
|
||||||
|
}
|
||||||
e.setAttribute("data-render", "true");
|
e.setAttribute("data-render", "true");
|
||||||
if (left) {
|
if (left) {
|
||||||
e.querySelector(".av__scroll").scrollLeft = left;
|
e.querySelector(".av__scroll").scrollLeft = left;
|
||||||
|
@ -44,8 +44,8 @@ export const resize = (protyle: IProtyle) => {
|
|||||||
}
|
}
|
||||||
if (abs.padding > MIN_ABS || abs.width > MIN_ABS || isNaN(abs.padding)) {
|
if (abs.padding > MIN_ABS || abs.width > MIN_ABS || isNaN(abs.padding)) {
|
||||||
protyle.wysiwyg.element.querySelectorAll(".av").forEach((item: HTMLElement) => {
|
protyle.wysiwyg.element.querySelectorAll(".av").forEach((item: HTMLElement) => {
|
||||||
item.style.width = item.parentElement.clientWidth + "px";
|
item.style.maxWidth = item.parentElement.clientWidth + "px";
|
||||||
if (item.getAttribute("data-render") === "true") {
|
if (item.getAttribute("data-render") === "true" && !item.style.width.endsWith("%")) {
|
||||||
const paddingLeft = item.parentElement.style.paddingLeft;
|
const paddingLeft = item.parentElement.style.paddingLeft;
|
||||||
const paddingRight = item.parentElement.style.paddingRight;
|
const paddingRight = item.parentElement.style.paddingRight;
|
||||||
const avHeaderElement = item.firstElementChild.firstElementChild as HTMLElement;
|
const avHeaderElement = item.firstElementChild.firstElementChild as HTMLElement;
|
||||||
|
Loading…
Reference in New Issue
Block a user