mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-09-22 00:20:47 +02:00
This commit is contained in:
parent
7206fc107d
commit
7300a4849c
2 changed files with 23 additions and 2 deletions
|
@ -28,6 +28,14 @@
|
|||
&[data-type="select"] {
|
||||
padding-left: 6px;
|
||||
}
|
||||
|
||||
span.b3-menu__avemoji {
|
||||
line-height: 26px;
|
||||
|
||||
img {
|
||||
margin-top: 6px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&__avheader {
|
||||
|
|
|
@ -4,7 +4,7 @@ import {escapeAriaLabel, escapeAttr, escapeHtml} from "../../../util/escape";
|
|||
import * as dayjs from "dayjs";
|
||||
import {popTextCell, updateCellsValue} from "./cell";
|
||||
import {hasClosestBlock, hasClosestByAttribute, hasClosestByClassName} from "../../util/hasClosest";
|
||||
import {unicode2Emoji} from "../../../emoji";
|
||||
import {openEmojiPanel, unicode2Emoji} from "../../../emoji";
|
||||
import {transaction} from "../../wysiwyg/transaction";
|
||||
import {openMenuPanel} from "./openMenuPanel";
|
||||
import {uploadFiles} from "../../upload";
|
||||
|
@ -465,7 +465,20 @@ const openEdit = (protyle: IProtyle, element: HTMLElement, event: MouseEvent) =>
|
|||
}
|
||||
while (target && element !== target) {
|
||||
const type = target.getAttribute("data-type");
|
||||
if (target.classList.contains("av__celltext--url") || target.classList.contains("av__cellassetimg")) {
|
||||
if (target.classList.contains("b3-menu__avemoji")) {
|
||||
const rect = target.getBoundingClientRect();
|
||||
openEmojiPanel(target.nextElementSibling.getAttribute("data-id"), "doc", {
|
||||
x: rect.left,
|
||||
y: rect.bottom,
|
||||
h: rect.height,
|
||||
w: rect.width,
|
||||
}, (unicode) => {
|
||||
target.innerHTML = unicode2Emoji(unicode || window.siyuan.storage[Constants.LOCAL_IMAGES].file);
|
||||
}, target.querySelector("img"));
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
return true;
|
||||
} else if (target.classList.contains("av__celltext--url") || target.classList.contains("av__cellassetimg")) {
|
||||
if (event.type === "contextmenu" || (!target.dataset.url && target.tagName !== "IMG")) {
|
||||
let index = 0;
|
||||
Array.from(target.parentElement.children).find((item, i) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue