Vanessa 2023-10-04 21:54:39 +08:00
parent 524fbca868
commit 18d4c5800c
3 changed files with 16 additions and 3 deletions

View file

@ -198,6 +198,7 @@ export const openEmojiPanel = (id: string, type: "doc" | "notebook" | "av", posi
window.siyuan.menus.menu.removeScrollEvent(); window.siyuan.menus.menu.removeScrollEvent();
} }
const dialog = new Dialog({ const dialog = new Dialog({
disableAnimation: true,
transparent: true, transparent: true,
hideCloseIcon: true, hideCloseIcon: true,
width: isMobile() ? "80vw" : "360px", width: isMobile() ? "80vw" : "360px",

View file

@ -102,8 +102,8 @@ export const getEditHTML = (options: {
<span class="b3-menu__label ft__center">${window.siyuan.languages.edit}</span> <span class="b3-menu__label ft__center">${window.siyuan.languages.edit}</span>
</button> </button>
<button class="b3-menu__separator"></button> <button class="b3-menu__separator"></button>
<button class="b3-menu__item"> <button class="b3-menu__item" data-type="nobg">
<svg class="b3-menu__icon"><use xlink:href="#${getColIconByType(colData.type)}"></use></svg> <span style="padding: 5px;margin-right: 8px;" class="block__icon block__icon--show" data-type="update-icon"><svg><use xlink:href="#${getColIconByType(colData.type)}"></use></svg></span>
<span class="b3-menu__label"><input data-type="name" style="margin: 4px 0" class="b3-text-field" type="text" value="${colData.name}"></span> <span class="b3-menu__label"><input data-type="name" style="margin: 4px 0" class="b3-text-field" type="text" value="${colData.name}"></span>
</button>`; </button>`;
if (colData.options && colData.options.length > 0) { if (colData.options && colData.options.length > 0) {
@ -387,7 +387,7 @@ export const showColMenu = (protyle: IProtyle, blockElement: Element, cellElemen
}]); }]);
}); });
menu.addItem({ menu.addItem({
iconHTML: `<span style="align-self: center;margin-right: 8px;" class="block__icon block__icon--show" data-type="update-icon"><svg><use xlink:href="#${getColIconByType(type)}"></use></svg></span>`, iconHTML: `<span style="align-self: center;margin-right: 8px;" class="block__icon block__icon--show"><svg><use xlink:href="#${getColIconByType(type)}"></use></svg></span>`,
type: "readonly", type: "readonly",
label: `<input style="margin: 4px 0" class="b3-text-field" type="text" value="${cellElement.innerText.trim()}">`, label: `<input style="margin: 4px 0" class="b3-text-field" type="text" value="${cellElement.innerText.trim()}">`,
bind(element) { bind(element) {

View file

@ -14,6 +14,7 @@ import {addAssetLink, bindAssetEvent, editAssetItem, getAssetHTML, updateAssetCe
import {Constants} from "../../../constants"; import {Constants} from "../../../constants";
import {hideElements} from "../../ui/hideElements"; import {hideElements} from "../../ui/hideElements";
import {pathPosix} from "../../../util/pathName"; import {pathPosix} from "../../../util/pathName";
import {openEmojiPanel} from "../../../emoji";
export const openMenuPanel = (options: { export const openMenuPanel = (options: {
protyle: IProtyle, protyle: IProtyle,
@ -501,6 +502,17 @@ export const openMenuPanel = (options: {
event.preventDefault(); event.preventDefault();
event.stopPropagation(); event.stopPropagation();
break; break;
} else if (type === "update-icon") {
const rect = target.getBoundingClientRect();
openEmojiPanel("", "av", {
x: rect.left,
y: rect.bottom,
h: rect.height,
w: rect.width
});
event.preventDefault();
event.stopPropagation();
break;
} else if (type === "showAllCol") { } else if (type === "showAllCol") {
const doOperations: IOperation[] = []; const doOperations: IOperation[] = [];
const undoOperations: IOperation[] = []; const undoOperations: IOperation[] = [];