Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:bug: Adjust database option editor layout on mobile https://github.com/siyuan-note/siyuan/issues/19627

Danield53ef863e395
diff --git a/app/src/assets/scss/business/_av.scss b/app/src/assets/scss/business/_av.scss
index 9d00f14272..a3979ec2e6 100644
--- a/app/src/assets/scss/business/_av.scss
+++ b/app/src/assets/scss/business/_av.scss
@@ -2713,6 +2713,23 @@ img.av__cellassetimg {
}
}
+.av__option-colors {
+ width: 238px;
+ max-width: 100%;
+ max-height: 238px;
+ overflow: auto;
+}
+
+.b3-menu--fullscreen {
+ .b3-menu__custom.av__option-custom {
+ padding: 0;
+ }
+
+ .av__option-colors {
+ width: 100%;
+ }
+}
+
.av__relation-drag-ghost {
align-items: center;
background-color: var(--b3-menu-background);
diff --git a/app/src/protyle/render/av/select.ts b/app/src/protyle/render/av/select.ts
index 6eac0ffd55..78dde125fe 100644
--- a/app/src/protyle/render/av/select.ts
+++ b/app/src/protyle/render/av/select.ts
@@ -292,7 +292,7 @@ export const setColOption = (protyle: IProtyle, data: IAV, target: HTMLElement,
${isMobile() ? "" : '<div class="fn__hr--small"></div>'}`,
bind(element) {
const inputElement = element.querySelector("input");
- element.classList.add("b3-menu__custom");
+ element.classList.add("b3-menu__custom", "av__option-custom");
inputElement.addEventListener("keydown", (event: KeyboardEvent) => {
if (event.isComposing) {
return;
@@ -405,14 +405,14 @@ ${isMobile() ? "" : '<div class="fn__hr--small"></div>'}`,
}
});
menu.addSeparator();
- const html = `<div class="fn__flex fn__flex-wrap" style="width:238px;max-height:238px;overflow:auto">${getAVColorGridHTML(
+ const html = `<div class="fn__flex fn__flex-wrap av__option-colors">${getAVColorGridHTML(
getAVCustomColors(), color, window.siyuan.languages.manageColors, getAVColorOrder())}</div>`;
menu.addItem({
type: "empty",
iconHTML: "",
label: html,
bind(element) {
- element.classList.add("b3-menu__custom");
+ element.classList.add("b3-menu__custom", "av__option-custom");
element.addEventListener("click", (event) => {
const colorTarget = (event.target as HTMLElement).closest<HTMLElement>("button");
if (colorTarget?.dataset.type === AV_MANAGE_CUSTOM_COLORS_TYPE) {