mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Full Screen mode (#1212)
This commit is contained in:
parent
81b38d8808
commit
2de4fe29ad
8 changed files with 42 additions and 7 deletions
|
@ -4,6 +4,8 @@ import { ToolButton } from "../components/ToolButton";
|
|||
import { t } from "../i18n";
|
||||
import { showSelectedShapeActions } from "../element";
|
||||
import { register } from "./register";
|
||||
import { allowFullScreen, exitFullScreen, isFullScreen } from "../utils";
|
||||
import { KEYS } from "../keys";
|
||||
|
||||
export const actionToggleCanvasMenu = register({
|
||||
name: "toggleCanvasMenu",
|
||||
|
@ -45,3 +47,19 @@ export const actionToggleEditMenu = register({
|
|||
/>
|
||||
),
|
||||
});
|
||||
|
||||
export const actionFullScreen = register({
|
||||
name: "toggleFullScreen",
|
||||
perform: () => {
|
||||
if (!isFullScreen()) {
|
||||
allowFullScreen();
|
||||
}
|
||||
if (isFullScreen()) {
|
||||
exitFullScreen();
|
||||
}
|
||||
return {
|
||||
commitToHistory: false,
|
||||
};
|
||||
},
|
||||
keyTest: (event) => event.keyCode === KEYS.F_KEY_CODE,
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue