mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-14 20:58:51 +01:00
This commit is contained in:
parent
cec9a2520f
commit
135c80fcb2
15 changed files with 30 additions and 0 deletions
|
|
@ -380,6 +380,22 @@ const editKeydown = (app: App, event: KeyboardEvent) => {
|
|||
updateReadonly(protyle.breadcrumb.element.parentElement.querySelector('.block__icon[data-type="readonly"]'), protyle);
|
||||
return true;
|
||||
}
|
||||
if (matchHotKey(window.siyuan.config.keymap.editor.general.switchAdjust.custom, event)) {
|
||||
event.preventDefault();
|
||||
let fullWidth;
|
||||
const adjustWidth = protyle.wysiwyg.element.getAttribute(Constants.CUSTOM_SY_FULLWIDTH)
|
||||
if (!adjustWidth) {
|
||||
fullWidth = window.siyuan.config.editor.fullWidth ? "false" : "true";
|
||||
} else {
|
||||
fullWidth = adjustWidth === "true" ? "false" : "true";
|
||||
}
|
||||
fetchPost("/api/attr/setBlockAttrs", {
|
||||
id: protyle.block.rootID,
|
||||
attrs: {[Constants.CUSTOM_SY_FULLWIDTH]: fullWidth}
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
if (matchHotKey(window.siyuan.config.keymap.editor.general.backlinks.custom, event)) {
|
||||
event.preventDefault();
|
||||
if (range) {
|
||||
|
|
|
|||
|
|
@ -459,6 +459,7 @@ export abstract class Constants {
|
|||
exitFocus: {default: "", custom: ""},
|
||||
ai: {default: "", custom: ""},
|
||||
switchReadonly: {default: "", custom: ""},
|
||||
switchAdjust: {default: "", custom: ""},
|
||||
},
|
||||
insert: {
|
||||
appearance: {default: "⌥⌘X", custom: "⌥⌘X"},
|
||||
|
|
|
|||
1
app/src/types/config.d.ts
vendored
1
app/src/types/config.d.ts
vendored
|
|
@ -885,6 +885,7 @@ declare namespace Config {
|
|||
showInFolder: IKey;
|
||||
spaceRepetition: IKey;
|
||||
switchReadonly: IKey;
|
||||
switchAdjust: IKey;
|
||||
undo: IKey;
|
||||
vLayout: IKey;
|
||||
wysiwyg: IKey;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue