mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-24 02:20:13 +01:00
This commit is contained in:
parent
3a8aa2cd25
commit
8a08964a53
2 changed files with 17 additions and 6 deletions
|
|
@ -1,6 +1,12 @@
|
|||
import {hasClosestBlock, hasClosestByMatchTag} from "../protyle/util/hasClosest";
|
||||
import {MenuItem} from "./Menu";
|
||||
import {focusBlock, focusByRange, focusByWbr, getEditorRange, selectAll} from "../protyle/util/selection";
|
||||
import {
|
||||
focusBlock,
|
||||
focusByRange,
|
||||
focusByWbr,
|
||||
getEditorRange,
|
||||
selectAll,
|
||||
} from "../protyle/util/selection";
|
||||
import {
|
||||
deleteColumn,
|
||||
deleteRow,
|
||||
|
|
@ -38,6 +44,8 @@ import {pushBack} from "../mobile/util/MobileBackFoward";
|
|||
import {exportAsset} from "./util";
|
||||
import {removeLink} from "../protyle/toolbar/Link";
|
||||
import {alignImgCenter, alignImgLeft} from "../protyle/wysiwyg/commonHotkey";
|
||||
import {getEnableHTML} from "../protyle/wysiwyg/removeEmbed";
|
||||
import {getContenteditableElement} from "../protyle/wysiwyg/getBlock";
|
||||
|
||||
export const refMenu = (protyle: IProtyle, element: HTMLElement) => {
|
||||
const nodeElement = hasClosestBlock(element);
|
||||
|
|
@ -310,11 +318,17 @@ export const contentMenu = (protyle: IProtyle, nodeElement: Element) => {
|
|||
html += (item as Element).outerHTML;
|
||||
}
|
||||
});
|
||||
if (protyle.disabled) {
|
||||
html = getEnableHTML(html)
|
||||
}
|
||||
const tempElement = document.createElement("template");
|
||||
tempElement.innerHTML = protyle.lute.BlockDOM2HTML(html);
|
||||
writeText(tempElement.content.firstElementChild.innerHTML);
|
||||
}
|
||||
}).element);
|
||||
if (protyle.disabled) {
|
||||
return;
|
||||
}
|
||||
window.siyuan.menus.menu.append(new MenuItem({
|
||||
icon: "iconCut",
|
||||
accelerator: "⌘X",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue