mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-27 11:58:49 +01:00
This commit is contained in:
parent
81eaf66621
commit
803fb6def8
3 changed files with 17 additions and 16 deletions
|
|
@ -171,14 +171,21 @@ export const avClick = (protyle: IProtyle, event: MouseEvent & { target: HTMLEle
|
|||
|
||||
const addRowElement = hasClosestByClassName(event.target, "av__row--add");
|
||||
if (addRowElement) {
|
||||
if (protyle.hint.element.classList.contains("fn__none")) {
|
||||
protyle.toolbar.range = document.createRange();
|
||||
protyle.toolbar.range.selectNodeContents(blockElement.querySelector(".av__title"));
|
||||
focusByRange(protyle.toolbar.range);
|
||||
hintRef("", protyle, "av");
|
||||
} else {
|
||||
hideElements(["hint"], protyle);
|
||||
}
|
||||
const avID = blockElement.getAttribute("data-av-id");
|
||||
const srcIDs = [Lute.NewNodeID()]
|
||||
const previousID = addRowElement.getAttribute("data-id") || "", ;
|
||||
transaction(protyle, [{
|
||||
action: "insertAttrViewBlock",
|
||||
avID,
|
||||
previousID,
|
||||
srcIDs,
|
||||
isDetached: true,
|
||||
}], [{
|
||||
action: "removeAttrViewBlock",
|
||||
srcIDs,
|
||||
avID,
|
||||
}]);
|
||||
insertAttrViewBlockAnimation(blockElement, 1, previousID);
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -1605,14 +1605,7 @@ export class WYSIWYG {
|
|||
event
|
||||
});
|
||||
});
|
||||
|
||||
const addRowElement = hasClosestByClassName(event.target, "av__row--add");
|
||||
if (addRowElement) {
|
||||
hideElements(["util"], protyle);
|
||||
} else {
|
||||
hideElements(["hint", "util"], protyle);
|
||||
}
|
||||
|
||||
hideElements(["hint", "util"], protyle);
|
||||
const ctrlIsPressed = event.metaKey || event.ctrlKey;
|
||||
/// #if !MOBILE
|
||||
const backlinkBreadcrumbItemElement = hasClosestByClassName(event.target, "protyle-breadcrumb__item");
|
||||
|
|
|
|||
1
app/src/types/index.d.ts
vendored
1
app/src/types/index.d.ts
vendored
|
|
@ -373,6 +373,7 @@ interface IOperation {
|
|||
previousID?: string
|
||||
retData?: any
|
||||
nextID?: string // insert 专享
|
||||
isDetached?: boolean // insertAttrViewBlock 专享
|
||||
srcIDs?: string[] // insertAttrViewBlock 专享
|
||||
name?: string // addAttrViewCol 专享
|
||||
type?: TAVCol // addAttrViewCol 专享
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue