mirror of
https://github.com/docmost/docmost.git
synced 2025-11-13 16:32:36 +10:00
This reverts commit d07338861b.
This commit is contained in:
@ -5,7 +5,6 @@ import PageEditor from "@/features/editor/page-editor";
|
|||||||
import { Container } from "@mantine/core";
|
import { Container } from "@mantine/core";
|
||||||
import { useAtom } from "jotai";
|
import { useAtom } from "jotai";
|
||||||
import { userAtom } from "@/features/user/atoms/current-user-atom.ts";
|
import { userAtom } from "@/features/user/atoms/current-user-atom.ts";
|
||||||
import { useOs } from "@mantine/hooks";
|
|
||||||
|
|
||||||
const MemoizedTitleEditor = React.memo(TitleEditor);
|
const MemoizedTitleEditor = React.memo(TitleEditor);
|
||||||
const MemoizedPageEditor = React.memo(PageEditor);
|
const MemoizedPageEditor = React.memo(PageEditor);
|
||||||
@ -26,21 +25,12 @@ export function FullEditor({
|
|||||||
editable,
|
editable,
|
||||||
}: FullEditorProps) {
|
}: FullEditorProps) {
|
||||||
const [user] = useAtom(userAtom);
|
const [user] = useAtom(userAtom);
|
||||||
const os = useOs();
|
|
||||||
|
|
||||||
const fullPageWidth = user.settings?.preferences?.fullPageWidth;
|
const fullPageWidth = user.settings?.preferences?.fullPageWidth;
|
||||||
|
|
||||||
// intercept ctrl+s to prevent default browser save behavior
|
|
||||||
document.addEventListener("keydown", function (e) {
|
|
||||||
if (editable && os === 'macos' ? e.metaKey : e.ctrlKey && e.code.toLowerCase() === 'keys') {
|
|
||||||
e.preventDefault();
|
|
||||||
}
|
|
||||||
}, false);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Container
|
<Container
|
||||||
fluid={fullPageWidth}
|
fluid={fullPageWidth}
|
||||||
{... (fullPageWidth && { mx: 80 })}
|
{...(fullPageWidth && { mx: 80 })}
|
||||||
size={850}
|
size={850}
|
||||||
className={classes.editor}
|
className={classes.editor}
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in New Issue
Block a user