Skip to content

Commit 155e77a

Browse files
committed
feat: Add className identifier to fullscreen mode. #217
1 parent 1292745 commit 155e77a

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

core/src/commands/fullscreen.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ const Fullscreen: React.FC<{ command: ICommand; editorProps: IMarkdownEditor & T
5252
if (editorProps && editorProps.container && editorProps.container.current && editorProps.editor) {
5353
const container = editorProps.container.current;
5454
document.body.style.overflow = full ? 'hidden' : 'initial';
55+
full
56+
? document.body.classList.add(`${editorProps.prefixCls}-fullscreen`)
57+
: document.body.classList.remove(`${editorProps.prefixCls}-fullscreen`);
5558
if (container && full) {
5659
container.style.zIndex = '999';
5760
container.style.position = 'fixed';

core/src/components/ToolBar/index.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export default function ToolBar(props: IToolBarProps) {
3434
execute(editor.current!);
3535
}
3636
}
37+
editorProps.prefixCls = prefixCls;
3738
return (
3839
<div
3940
className={`${prefixCls}-toolbar ${className || ''} ${mode ? `${prefixCls}-toolbar-mode` : ''}`}

core/src/index.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ export interface IMarkdownEditor extends ReactCodeMirrorProps {
5656
}
5757

5858
export interface ToolBarProps {
59+
prefixCls?: string;
5960
editor: React.RefObject<ReactCodeMirrorRef>;
6061
preview: React.RefObject<HTMLDivElement>;
6162
container: React.RefObject<HTMLDivElement>;
@@ -122,6 +123,7 @@ function MarkdownEditorInternal(
122123
);
123124

124125
const toolBarProps: ToolBarProps = {
126+
prefixCls,
125127
preview: preview,
126128
editor: codeMirror,
127129
container: container,

0 commit comments

Comments
 (0)