mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-27 03:48:48 +01:00
🎨 https://github.com/siyuan-note/siyuan/issues/5066 addFloatLayer
This commit is contained in:
parent
768555ca4b
commit
66e2371164
6 changed files with 50 additions and 18 deletions
|
|
@ -8,6 +8,7 @@ import {Custom} from "../layout/dock/Custom";
|
|||
import {Tab} from "../layout/Tab";
|
||||
import {getDockByType, setPanelFocus} from "../layout/util";
|
||||
import {hasClosestByAttribute} from "../protyle/util/hasClosest";
|
||||
import {BlockPanel} from "../block/Panel";
|
||||
|
||||
export class Plugin {
|
||||
private app: App;
|
||||
|
|
@ -198,4 +199,23 @@ export class Plugin {
|
|||
return this.docks[type2];
|
||||
/// #endif
|
||||
}
|
||||
|
||||
public addFloatLayer = (options: {
|
||||
ids: string[],
|
||||
defIds?: string[],
|
||||
x?: number,
|
||||
y?: number,
|
||||
targetElement?: HTMLElement,
|
||||
isBacklink: boolean,
|
||||
}) => {
|
||||
window.siyuan.blockPanels.push(new BlockPanel({
|
||||
app: this.app,
|
||||
targetElement: options.targetElement,
|
||||
isBacklink: options.isBacklink,
|
||||
x: options.x,
|
||||
y: options.y,
|
||||
nodeIds: options.ids,
|
||||
defIds: options.defIds,
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue