mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-11 09:44:21 +01:00
This commit is contained in:
parent
eb92b9acf4
commit
3ec2ff243f
5 changed files with 49 additions and 25 deletions
|
|
@ -3,7 +3,7 @@ import {
|
|||
hasClosestByAttribute,
|
||||
hasClosestByClassName,
|
||||
hasClosestByMatchTag,
|
||||
hasClosestByTag
|
||||
hasClosestByTag, hasTopClosestByClassName
|
||||
} from "../util/hasClosest";
|
||||
import {getIconByType} from "../../editor/getIcon";
|
||||
import {enterBack, iframeMenu, setFold, tableMenu, videoMenu, zoomOut} from "../../menus/protyle";
|
||||
|
|
@ -312,7 +312,8 @@ export class Gutter {
|
|||
window.siyuan.menus.menu.fullscreen();
|
||||
} else {
|
||||
window.siyuan.menus.menu.popup({x: gutterRect.left, y: gutterRect.bottom, isLeft: true});
|
||||
window.siyuan.menus.menu.element.setAttribute("data-from", hasClosestByClassName(protyle.element, "block__edit") ? "popover" : "app");
|
||||
const popoverElement = hasTopClosestByClassName(protyle.element, "block__popover", true);
|
||||
window.siyuan.menus.menu.element.setAttribute("data-from", popoverElement ? popoverElement.dataset.level + "popover" : "app");
|
||||
focusByRange(protyle.toolbar.range);
|
||||
}
|
||||
}
|
||||
|
|
@ -343,7 +344,8 @@ export class Gutter {
|
|||
} else if (buttonElement.dataset.type !== "NodeAttributeViewRow") {
|
||||
this.renderMenu(protyle, buttonElement);
|
||||
window.siyuan.menus.menu.popup({x: gutterRect.left, y: gutterRect.bottom, isLeft: true});
|
||||
window.siyuan.menus.menu.element.setAttribute("data-from", hasClosestByClassName(protyle.element, "block__edit") ? "popover" : "app");
|
||||
const popoverElement = hasTopClosestByClassName(protyle.element, "block__popover", true);
|
||||
window.siyuan.menus.menu.element.setAttribute("data-from", popoverElement ? popoverElement.dataset.level + "popover" : "app");
|
||||
}
|
||||
}
|
||||
event.preventDefault();
|
||||
|
|
@ -790,7 +792,7 @@ export class Gutter {
|
|||
label: window.siyuan.languages.addToDatabase,
|
||||
icon: "iconDatabase",
|
||||
click: () => {
|
||||
openSearchAV("", this.element, (listItemElement) => {
|
||||
openSearchAV("", selectsElement[0] as HTMLElement, (listItemElement) => {
|
||||
const sourceIds: string[] = [];
|
||||
selectsElement.forEach(item => {
|
||||
sourceIds.push(item.getAttribute("data-node-id"));
|
||||
|
|
@ -1242,7 +1244,7 @@ export class Gutter {
|
|||
label: window.siyuan.languages.addToDatabase,
|
||||
icon: "iconDatabase",
|
||||
click: () => {
|
||||
openSearchAV("", this.element, (listItemElement) => {
|
||||
openSearchAV("", nodeElement as HTMLElement, (listItemElement) => {
|
||||
const sourceIds: string[] = [nodeElement.getAttribute("data-node-id")];
|
||||
const avID = listItemElement.dataset.avId;
|
||||
transaction(protyle, [{
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import {Menu} from "../../../plugin/Menu";
|
||||
import {hasClosestByClassName} from "../../util/hasClosest";
|
||||
import {hasClosestByClassName, hasTopClosestByClassName} from "../../util/hasClosest";
|
||||
import {upDownHint} from "../../../util/upDownHint";
|
||||
import {fetchPost} from "../../../util/fetch";
|
||||
import {escapeHtml} from "../../../util/escape";
|
||||
import {escapeGreat, escapeHtml} from "../../../util/escape";
|
||||
import {transaction} from "../../wysiwyg/transaction";
|
||||
import {updateCellsValue} from "./cell";
|
||||
import {updateAttrViewCellAnimation} from "./action";
|
||||
|
|
@ -23,7 +23,7 @@ const genSearchList = (element: Element, keyword: string, avId: string, cb?: ()
|
|||
<div class="b3-list-item__first">
|
||||
<span class="b3-list-item__text">${escapeHtml(item.avName || window.siyuan.languages.title)}</span>
|
||||
</div>
|
||||
<div class="b3-list-item__meta b3-list-item__showall">${escapeHtml(item.hPath)}</div>
|
||||
<div class="b3-list-item__meta b3-list-item__showall">${escapeGreat(item.hPath)}</div>
|
||||
</div>
|
||||
<svg aria-label="${window.siyuan.languages.thisDatabase}" style="margin: 0 0 0 4px" class="b3-list-item__hinticon ariaLabel${item.avID === avId ? "" : " fn__none"}"><use xlink:href="#iconInfo"></use></svg>
|
||||
</div>`;
|
||||
|
|
@ -115,6 +115,8 @@ export const openSearchAV = (avId: string, target: HTMLElement, cb?: (element: H
|
|||
}
|
||||
});
|
||||
menu.element.querySelector(".b3-menu__items").setAttribute("style", "overflow: initial");
|
||||
const popoverElement = hasTopClosestByClassName(target, "block__popover", true);
|
||||
menu.element.setAttribute("data-from", popoverElement ? popoverElement.dataset.level + "popover" : "app");
|
||||
};
|
||||
|
||||
export const updateRelation = (options: {
|
||||
|
|
@ -251,7 +253,7 @@ export const bindRelationEvent = (options: {
|
|||
fetchPost("/api/av/getAttributeViewPrimaryKeyValues", {
|
||||
id: options.menuElement.firstElementChild.getAttribute("data-av-id"),
|
||||
}, response => {
|
||||
const cells=response.data.rows.values as IAVCellValue[];
|
||||
const cells = response.data.rows.values as IAVCellValue[];
|
||||
let html = "";
|
||||
let selectHTML = "";
|
||||
hasIds.forEach(hasId => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue