Vanessa 2023-07-10 10:40:29 +08:00
parent 807db89c5e
commit 41fcb61908
3 changed files with 5 additions and 5 deletions

View file

@ -1097,6 +1097,6 @@
iconSub
</div>
</div>
<script src="ant/icon.js"></script>
<script src="material/icon.js"></script>
</body>
</html>

View file

@ -67,7 +67,7 @@ export const openMenuPanel = (protyle: IProtyle,
return;
}
const target = event.target as HTMLElement;
const targetElement = hasClosestByAttribute(target, "data-id", null);
const targetElement = hasClosestByAttribute(target, "draggable", "true");
if (!targetElement ||
(!targetElement.classList.contains("dragover__top") && !targetElement.classList.contains("dragover__bottom"))) {
return;
@ -154,7 +154,7 @@ export const openMenuPanel = (protyle: IProtyle,
let dragoverElement: HTMLElement;
avPanelElement.addEventListener("dragover", (event: DragEvent) => {
const target = event.target as HTMLElement;
const targetElement = hasClosestByAttribute(target, "data-id", null);
const targetElement = hasClosestByAttribute(target, "draggable", "true");
if (!targetElement || targetElement.isSameNode(window.siyuan.dragElement)) {
return;
}
@ -172,7 +172,7 @@ export const openMenuPanel = (protyle: IProtyle,
});
avPanelElement.addEventListener("dragleave", (event) => {
const target = event.target as HTMLElement;
const targetElement = hasClosestByAttribute(target, "data-id", null);
const targetElement = hasClosestByAttribute(target, "draggable", "true");
if (targetElement) {
targetElement.classList.remove("dragover__top", "dragover__bottom");
}

View file

@ -185,7 +185,7 @@ export const setSelectCol = (protyle: IProtyle, data: IAV, options: {
menu.addSeparator();
Array.from(Array(13).keys()).forEach(index => {
menu.addItem({
current: parseInt(color) === index + 1,
accelerator: parseInt(color) === index + 1 ? '<svg class="svg" style="height: 30px; float: left;"><use xlink:href="#iconSelect"></use></svg>' : undefined,
iconHTML: "",
label: `<span class="color__square" style="padding: 5px;margin: 2px;color: var(--b3-font-color${index + 1});background-color: var(--b3-font-background${index + 1});">A</span>`,
click() {