mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
feat: allow readonly actions to be used in viewMode (#5982)
This commit is contained in:
parent
8466eb0eef
commit
cc9e764585
11 changed files with 18 additions and 12 deletions
|
@ -90,6 +90,7 @@ export const actionClearCanvas = register({
|
|||
|
||||
export const actionZoomIn = register({
|
||||
name: "zoomIn",
|
||||
viewMode: true,
|
||||
trackEvent: { category: "canvas" },
|
||||
perform: (_elements, appState, _, app) => {
|
||||
return {
|
||||
|
@ -126,6 +127,7 @@ export const actionZoomIn = register({
|
|||
|
||||
export const actionZoomOut = register({
|
||||
name: "zoomOut",
|
||||
viewMode: true,
|
||||
trackEvent: { category: "canvas" },
|
||||
perform: (_elements, appState, _, app) => {
|
||||
return {
|
||||
|
@ -162,6 +164,7 @@ export const actionZoomOut = register({
|
|||
|
||||
export const actionResetZoom = register({
|
||||
name: "resetZoom",
|
||||
viewMode: true,
|
||||
trackEvent: { category: "canvas" },
|
||||
perform: (_elements, appState, _, app) => {
|
||||
return {
|
||||
|
@ -271,6 +274,7 @@ export const actionZoomToSelected = register({
|
|||
|
||||
export const actionZoomToFit = register({
|
||||
name: "zoomToFit",
|
||||
viewMode: true,
|
||||
trackEvent: { category: "canvas" },
|
||||
perform: (elements, appState) => zoomToFitElements(elements, appState, false),
|
||||
keyTest: (event) =>
|
||||
|
@ -282,6 +286,7 @@ export const actionZoomToFit = register({
|
|||
|
||||
export const actionToggleTheme = register({
|
||||
name: "toggleTheme",
|
||||
viewMode: true,
|
||||
trackEvent: { category: "canvas" },
|
||||
perform: (_, appState, value) => {
|
||||
return {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue