feat: support create a dependent window

This commit is contained in:
Quorafind 2023-08-27 22:25:36 +08:00
parent 559af426f9
commit 87fa550d41
3 changed files with 15 additions and 3 deletions

View file

@ -1,7 +1,7 @@
{
"id": "float-search",
"name": "Floating Search",
"version": "3.3.1",
"version": "3.3.2",
"minAppVersion": "0.15.0",
"description": "You can use search view in modal now.",
"author": "Boninall",
@ -12,4 +12,4 @@
"支付宝": "https://cdn.jsdelivr.net/gh/Quorafind/.github@main/IMAGE/%E6%94%AF%E4%BB%98%E5%AE%9D%E4%BB%98%E6%AC%BE%E7%A0%81.jpg"
},
"isDesktopOnly": false
}
}

View file

@ -1,6 +1,6 @@
{
"name": "float-search",
"version": "3.3.1",
"version": "3.3.2",
"description": "You can use search view in modal now.",
"main": "main.js",
"scripts": {

View file

@ -286,6 +286,18 @@ export default class FloatSearchPlugin extends Plugin {
});
}
});
this.addCommand({
id: 'open-search-view-window',
name: 'Open Search View Window',
callback: async () => {
const leaf = app.workspace.getLeaf('window');
leaf.setPinned(true);
await leaf.setViewState({
type: "search",
});
}
});
}
registerEditorMenuHandler() {