mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-25 16:34:06 +01:00
🎨
This commit is contained in:
parent
461f0bb347
commit
290f39aed4
4 changed files with 17 additions and 15 deletions
|
|
@ -90,7 +90,7 @@ export const avClick = (protyle: IProtyle, event: MouseEvent & { target: HTMLEle
|
|||
srcIDs,
|
||||
avID,
|
||||
}]);
|
||||
insertAttrViewBlockAnimation(blockElement, 1, undefined, avID);
|
||||
insertAttrViewBlockAnimation(blockElement, srcIDs, undefined, avID);
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
return true;
|
||||
|
|
@ -160,7 +160,7 @@ export const avClick = (protyle: IProtyle, event: MouseEvent & { target: HTMLEle
|
|||
srcIDs,
|
||||
avID,
|
||||
}]);
|
||||
insertAttrViewBlockAnimation(blockElement, 1, previousID, avID);
|
||||
insertAttrViewBlockAnimation(blockElement, srcIDs, previousID, avID);
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
return true;
|
||||
|
|
@ -184,7 +184,7 @@ export const avClick = (protyle: IProtyle, event: MouseEvent & { target: HTMLEle
|
|||
srcIDs,
|
||||
avID,
|
||||
}]);
|
||||
insertAttrViewBlockAnimation(blockElement, 1, previousID, avID);
|
||||
insertAttrViewBlockAnimation(blockElement, srcIDs, previousID, avID);
|
||||
} else {
|
||||
const gutterRect = target.getBoundingClientRect();
|
||||
avContextmenu(protyle, rowElement, {
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ export const updateHeader = (rowElement: HTMLElement) => {
|
|||
avHeadElement.style.position = "sticky";
|
||||
};
|
||||
|
||||
export const insertAttrViewBlockAnimation = (blockElement: Element, size: number, previousId: string, avId?: string) => {
|
||||
export const insertAttrViewBlockAnimation = (blockElement: Element, srcIDs: string[], previousId: string, avId?: string,) => {
|
||||
const previousElement = blockElement.querySelector(`.av__row[data-id="${previousId}"]`) || blockElement.querySelector(".av__row--header");
|
||||
let colHTML = '<div style="width: 24px"></div>';
|
||||
const pinIndex = previousElement.querySelectorAll(".av__colsticky .av__cell").length - 1;
|
||||
|
|
@ -84,8 +84,8 @@ export const insertAttrViewBlockAnimation = (blockElement: Element, size: number
|
|||
});
|
||||
|
||||
let html = "";
|
||||
new Array(size).fill(1).forEach(() => {
|
||||
html += `<div class="av__row" data-avid="${avId}" data-previous-id="${previousId}">
|
||||
srcIDs.forEach((id) => {
|
||||
html += `<div class="av__row" data-id="${id}" data-avid="${avId}" data-previous-id="${previousId}">
|
||||
${colHTML}
|
||||
</div>`;
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue