diff --git a/app/src/assets/scss/component/_menu.scss b/app/src/assets/scss/component/_menu.scss index 8bc163a0c..adfab498d 100644 --- a/app/src/assets/scss/component/_menu.scss +++ b/app/src/assets/scss/component/_menu.scss @@ -4,7 +4,7 @@ box-shadow: var(--b3-dialog-shadow); border: 1px solid var(--b3-theme-surface-lighter); background-color: var(--b3-menu-background); - padding: 12px 0; + padding: 8px 0; z-index: 210; box-sizing: border-box; diff --git a/app/src/assets/scss/protyle/_toolbar.scss b/app/src/assets/scss/protyle/_toolbar.scss index 05db19b6d..a1ebcb60d 100644 --- a/app/src/assets/scss/protyle/_toolbar.scss +++ b/app/src/assets/scss/protyle/_toolbar.scss @@ -56,6 +56,8 @@ max-height: 402px; box-sizing: border-box; padding: 8px 0; + display: flex; + flex-direction: column; } &-util { @@ -64,7 +66,7 @@ box-shadow: var(--b3-dialog-shadow); border: 1px solid var(--b3-theme-surface-lighter); background-color: var(--b3-menu-background); - padding: 8px; + padding: 8px 0; max-height: 80vh; z-index: 4; box-sizing: border-box; diff --git a/app/src/protyle/header/Background.ts b/app/src/protyle/header/Background.ts index ace7f0bb2..cc0b39bdc 100644 --- a/app/src/protyle/header/Background.ts +++ b/app/src/protyle/header/Background.ts @@ -438,7 +438,7 @@ export class Background { html += `
${item}
`; }); window.siyuan.menus.menu.remove(); - window.siyuan.menus.menu.element.lastElementChild.innerHTML = `
+ window.siyuan.menus.menu.element.lastElementChild.innerHTML = `
${html}
`; diff --git a/app/src/protyle/hint/index.ts b/app/src/protyle/hint/index.ts index 73d4de31d..a979557ff 100644 --- a/app/src/protyle/hint/index.ts +++ b/app/src/protyle/hint/index.ts @@ -239,13 +239,9 @@ ${unicode2Emoji(emoji.unicode)}`; } private getHTMLByData(data: IHintData[], hasSearch = false) { - let hintsHTML = ""; + let hintsHTML = '
'; if (hasSearch) { - hintsHTML = '
'; - this.element.style.display = "flex"; - this.element.style.flexDirection = "column"; - } else { - this.element.style.display = ""; + hintsHTML = '
'; } data.forEach((hintData, i) => { // https://github.com/siyuan-note/siyuan/issues/1229 提示时,新建文件不应默认选中 @@ -260,10 +256,7 @@ ${unicode2Emoji(emoji.unicode)}`; hintsHTML += ``; } }); - if (hasSearch) { - hintsHTML = hintsHTML + "
"; - } - return hintsHTML; + return `${hintsHTML}
`; } public genHTML(data: IHintData[], protyle: IProtyle, hide = false, hasSearch = false) { diff --git a/app/src/protyle/render/av/action.ts b/app/src/protyle/render/av/action.ts index c06882f3a..ab1cd3a0d 100644 --- a/app/src/protyle/render/av/action.ts +++ b/app/src/protyle/render/av/action.ts @@ -8,6 +8,7 @@ import {getColIconByType, showColMenu, updateHeader} from "./col"; import {emitOpenMenu} from "../../../plugin/EventBus"; import {addCol} from "./addCol"; import {openMenuPanel} from "./openMenuPanel"; +import {hintRef} from "../../hint/extend"; export const avClick = (protyle: IProtyle, event: MouseEvent & { target: HTMLElement }) => { const blockElement = hasClosestBlock(event.target); @@ -127,6 +128,14 @@ export const avClick = (protyle: IProtyle, event: MouseEvent & { target: HTMLEle event.stopPropagation(); return true; } + + const addRowElement = hasClosestByClassName(event.target, "av__row--add"); + if (addRowElement) { + hintRef("", protyle, true); + event.preventDefault(); + event.stopPropagation(); + return true; + } return false; }; diff --git a/app/src/protyle/toolbar/index.ts b/app/src/protyle/toolbar/index.ts index 37f283c6f..d6b52e6d7 100644 --- a/app/src/protyle/toolbar/index.ts +++ b/app/src/protyle/toolbar/index.ts @@ -1146,7 +1146,7 @@ export class Toolbar { }); this.subElement.style.width = ""; this.subElement.style.padding = ""; - this.subElement.innerHTML = `
+ this.subElement.innerHTML = `
${html}
`; @@ -1271,7 +1271,7 @@ export class Toolbar { this.subElement.style.padding = ""; this.subElement.innerHTML = `
-
+
@@ -1444,7 +1444,7 @@ export class Toolbar { window.siyuan.menus.menu.remove(); this.subElement.style.width = ""; this.subElement.style.padding = ""; - this.subElement.innerHTML = `
+ this.subElement.innerHTML = `
`; @@ -1511,7 +1511,7 @@ export class Toolbar { this.subElement.style.padding = ""; this.subElement.innerHTML = `
-
+