mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-28 09:54:07 +01:00
This commit is contained in:
parent
d579e7511f
commit
da11e337aa
6 changed files with 67 additions and 70 deletions
|
|
@ -235,7 +235,17 @@ export class Title {
|
|||
accelerator: "⌘V",
|
||||
click: async () => {
|
||||
focusByRange(getEditorRange(this.editElement));
|
||||
document.execCommand("paste");
|
||||
if (document.queryCommandSupported("paste")) {
|
||||
document.execCommand("paste");
|
||||
} else {
|
||||
try {
|
||||
const text = await readText();
|
||||
document.execCommand("insertText", false, replaceFileName(text));
|
||||
this.rename(protyle);
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}).element);
|
||||
window.siyuan.menus.menu.append(new MenuItem({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue