mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-26 10:16:10 +01:00
🚨
This commit is contained in:
parent
b0e3efa774
commit
2c36af78bc
14 changed files with 25 additions and 26 deletions
|
|
@ -278,15 +278,15 @@ export const avContextmenu = (protyle: IProtyle, event: MouseEvent & { detail: a
|
|||
menu.addSeparator();
|
||||
const editAttrSubmenu: IMenu[] = [];
|
||||
rowElement.parentElement.querySelectorAll(".av__row--header .av__cell").forEach((cellElement: HTMLElement) => {
|
||||
let hideBlock = false
|
||||
const selectElements: HTMLElement[] = Array.from(blockElement.querySelectorAll(`.av__row--select:not(.av__row--header) .av__cell[data-col-id="${cellElement.dataset.colId}"]`))
|
||||
let hideBlock = false;
|
||||
const selectElements: HTMLElement[] = Array.from(blockElement.querySelectorAll(`.av__row--select:not(.av__row--header) .av__cell[data-col-id="${cellElement.dataset.colId}"]`));
|
||||
if (cellElement.dataset.dtype === "block") {
|
||||
selectElements.find(item => {
|
||||
if (!item.dataset.detached) {
|
||||
hideBlock = true;
|
||||
return true;
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
if (!hideBlock) {
|
||||
editAttrSubmenu.push({
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ export const genAVValueHTML = (value: IAVCellValue) => {
|
|||
let html = "";
|
||||
switch (value.type) {
|
||||
case "text":
|
||||
html = `<textarea rows="${value.text.content.split('\n').length}" class="b3-text-field b3-text-field--text fn__flex-1">${value.text.content}</textarea>`;
|
||||
html = `<textarea rows="${value.text.content.split("\n").length}" class="b3-text-field b3-text-field--text fn__flex-1">${value.text.content}</textarea>`;
|
||||
break;
|
||||
case "number":
|
||||
html = `<input value="${value.number.content}" type="number" class="b3-text-field b3-text-field--text fn__flex-1">`;
|
||||
|
|
|
|||
|
|
@ -424,7 +424,7 @@ export const showColMenu = (protyle: IProtyle, blockElement: Element, cellElemen
|
|||
data: cellElement.dataset.icon,
|
||||
}]);
|
||||
iconElement.setAttribute("data-icon", unicode);
|
||||
iconElement.innerHTML = unicode ? unicode2Emoji(unicode) : `<svg><use xlink:href="#${getColIconByType(type)}"></use></svg>`
|
||||
iconElement.innerHTML = unicode ? unicode2Emoji(unicode) : `<svg><use xlink:href="#${getColIconByType(type)}"></use></svg>`;
|
||||
updateAttrViewCellAnimation(cellElement);
|
||||
});
|
||||
event.preventDefault();
|
||||
|
|
|
|||
|
|
@ -522,8 +522,8 @@ export const openMenuPanel = (options: {
|
|||
avID,
|
||||
data: target.dataset.icon,
|
||||
}]);
|
||||
target.innerHTML = unicode ? unicode2Emoji(unicode) : `<svg><use xlink:href="#${getColIconByType(target.dataset.colType as TAVCol)}"></use></svg>`
|
||||
updateAttrViewCellAnimation(options.blockElement.querySelector(`.av__row--header .av__cell[data-col-id="${colId}"]`))
|
||||
target.innerHTML = unicode ? unicode2Emoji(unicode) : `<svg><use xlink:href="#${getColIconByType(target.dataset.colType as TAVCol)}"></use></svg>`;
|
||||
updateAttrViewCellAnimation(options.blockElement.querySelector(`.av__row--header .av__cell[data-col-id="${colId}"]`));
|
||||
});
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue