mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-28 11:16:09 +01:00
This commit is contained in:
parent
a742bd49a6
commit
2889872b89
2 changed files with 21 additions and 4 deletions
|
|
@ -22,6 +22,7 @@ import {Model} from "../layout/Model";
|
|||
import {getDockByType} from "../layout/tabUtil";
|
||||
import {getAllEditor, getAllModels} from "../layout/getAll";
|
||||
import {openSetting} from "../config";
|
||||
import {openAttr, openFileAttr} from "../menus/commonMenuItem";
|
||||
|
||||
let openTab;
|
||||
let openWindow;
|
||||
|
|
@ -177,6 +178,19 @@ const getModelByDockType = (type: TDock | string) => {
|
|||
/// #endif
|
||||
};
|
||||
|
||||
const openAttributePanel = (options: {
|
||||
data?: IObject // 块属性值
|
||||
nodeElement?: HTMLElement, // 块元素
|
||||
focusName: "bookmark" | "name" | "alias" | "memo" | "av" | "custom", // av 为数据库页签,custom 为自定义页签,其余为内置输入框
|
||||
protyle?: IProtyle, // 有数据库时需要传入 protyle
|
||||
}) => {
|
||||
if (options.data) {
|
||||
openFileAttr(options.data, options.focusName, options.protyle);
|
||||
} else {
|
||||
openAttr(options.nodeElement, options.focusName, options.protyle);
|
||||
}
|
||||
};
|
||||
|
||||
export const API = {
|
||||
adaptHotkey: updateHotkeyTip,
|
||||
confirm: confirmDialog,
|
||||
|
|
@ -201,5 +215,6 @@ export const API = {
|
|||
getAllEditor,
|
||||
getAllModels,
|
||||
platformUtils,
|
||||
openSetting
|
||||
openSetting,
|
||||
openAttributePanel,
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue