mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-02-28 05:32:52 +00:00
This commit is contained in:
@@ -15,7 +15,6 @@ import {App} from "../index";
|
||||
import {Constants} from "../constants";
|
||||
import {textMenu} from "./text";
|
||||
|
||||
|
||||
export class Menus {
|
||||
public menu: Menu;
|
||||
|
||||
|
||||
@@ -9,6 +9,13 @@ export const textMenu = (target: Element) => {
|
||||
label: window.siyuan.languages.copy,
|
||||
icon: "iconCopy",
|
||||
click() {
|
||||
if (getSelection().rangeCount === 0) {
|
||||
return;
|
||||
}
|
||||
const range = getSelection().getRangeAt(0);
|
||||
if (!range.toString()) {
|
||||
getSelection().getRangeAt(0).selectNode(target);
|
||||
}
|
||||
document.execCommand("copy");
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user