mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-30 05:18:49 +01:00
This commit is contained in:
parent
06d78e0333
commit
767971be43
4 changed files with 27 additions and 0 deletions
|
|
@ -246,6 +246,11 @@
|
|||
&:hover svg {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
img {
|
||||
height: 36px;
|
||||
width: 24px;
|
||||
}
|
||||
}
|
||||
|
||||
&__widthdrag {
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ import {isMobile} from "../../util/functions";
|
|||
import {isCtrl, isIPhone} from "../util/compatibility";
|
||||
import {avRender} from "../render/av/render";
|
||||
import {genIconHTML} from "../render/util";
|
||||
import {insertAttrViewBlockAnimation} from "../render/av/action";
|
||||
|
||||
export class Hint {
|
||||
public timeId: number;
|
||||
|
|
@ -452,6 +453,7 @@ ${genHintItemHTML(item)}
|
|||
avID,
|
||||
}]);
|
||||
}
|
||||
insertAttrViewBlockAnimation(nodeElement, 1, previousID);
|
||||
return;
|
||||
}
|
||||
this.enableExtend = false;
|
||||
|
|
|
|||
|
|
@ -296,3 +296,20 @@ export const updateAVName = (protyle: IProtyle, blockElement: Element) => {
|
|||
}]);
|
||||
nameElement.dataset.title = nameElement.textContent.trim();
|
||||
};
|
||||
|
||||
export const insertAttrViewBlockAnimation = (blockElement: Element, size: number, previousId: string) => {
|
||||
const previousElement = blockElement.querySelector(`.av__row[data-id="${previousId}"]`) || blockElement.querySelector(`.av__row--header`);
|
||||
let colHTML = ""
|
||||
previousElement.querySelectorAll(".av__cell").forEach((item: HTMLElement) => {
|
||||
colHTML += `<div class="av__cell" style="width: ${item.style.width}"></div>`
|
||||
})
|
||||
|
||||
let html = ""
|
||||
new Array(size).fill(1).forEach(() => {
|
||||
html += `<div class="av__row">
|
||||
<div class="av__firstcol"><img src="/stage/loading-pure.svg"></div>
|
||||
${colHTML}
|
||||
</div>`
|
||||
})
|
||||
previousElement.insertAdjacentHTML("afterend", html)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ import {uploadLocalFiles} from "../upload";
|
|||
import {insertHTML} from "./insertHTML";
|
||||
import {isBrowser} from "../../util/functions";
|
||||
import {hideElements} from "../ui/hideElements";
|
||||
import {insertAttrViewBlockAnimation} from "../render/av/action";
|
||||
|
||||
const moveToNew = (protyle: IProtyle, sourceElements: Element[], targetElement: Element, newSourceElement: Element,
|
||||
isSameDoc: boolean, isBottom: boolean, isCopy: boolean) => {
|
||||
|
|
@ -882,6 +883,7 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => {
|
|||
srcIDs: sourceIds,
|
||||
avID,
|
||||
}]);
|
||||
insertAttrViewBlockAnimation(blockElement, sourceIds.length, previousID);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
@ -941,6 +943,7 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => {
|
|||
srcIDs: ids,
|
||||
avID,
|
||||
}]);
|
||||
insertAttrViewBlockAnimation(blockElement, ids.length, previousID);
|
||||
return;
|
||||
}
|
||||
for (let i = 0; i < ids.length; i++) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue