File tree 3 files changed +7
-7
lines changed
scenes/Document/components
3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ import UiStore from "stores/UiStore";
8
8
import ErrorBoundary from "components/ErrorBoundary" ;
9
9
import Tooltip from "components/Tooltip" ;
10
10
import embeds from "../embeds" ;
11
- import { isMetaKey } from "utils/keyboard" ;
11
+ import { isModKey } from "utils/keyboard" ;
12
12
import { uploadFile } from "utils/uploadFile" ;
13
13
import { isInternalUrl } from "utils/urls" ;
14
14
@@ -50,7 +50,7 @@ function Editor(props: PropsWithRef) {
50
50
return ;
51
51
}
52
52
53
- if ( isInternalUrl ( href ) && ! isMetaKey ( event ) && ! event . shiftKey ) {
53
+ if ( isInternalUrl ( href ) && ! isModKey ( event ) && ! event . shiftKey ) {
54
54
// relative
55
55
let navigateTo = href ;
56
56
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ import Editor from "components/Editor";
13
13
import Flex from "components/Flex" ;
14
14
import HoverPreview from "components/HoverPreview" ;
15
15
import Star , { AnimatedStar } from "components/Star" ;
16
- import { isMetaKey } from "utils/keyboard" ;
16
+ import { isModKey } from "utils/keyboard" ;
17
17
import { documentHistoryUrl } from "utils/routeHelpers" ;
18
18
19
19
type Props = {
@@ -55,7 +55,7 @@ class DocumentEditor extends React.Component<Props> {
55
55
handleTitleKeyDown = ( event : SyntheticKeyboardEvent < > ) => {
56
56
if ( event . key === "Enter" ) {
57
57
event . preventDefault ( ) ;
58
- if ( isMetaKey ( event ) ) {
58
+ if ( isModKey ( event ) ) {
59
59
this . props . onSave ( { done : true } ) ;
60
60
return ;
61
61
}
@@ -69,12 +69,12 @@ class DocumentEditor extends React.Component<Props> {
69
69
this . focusAtStart ( ) ;
70
70
return ;
71
71
}
72
- if ( event . key === "p" && isMetaKey ( event ) && event . shiftKey ) {
72
+ if ( event . key === "p" && isModKey ( event ) && event . shiftKey ) {
73
73
event . preventDefault ( ) ;
74
74
this . props . onSave ( { publish : true , done : true } ) ;
75
75
return ;
76
76
}
77
- if ( event . key === "s" && isMetaKey ( event ) ) {
77
+ if ( event . key === "s" && isModKey ( event ) ) {
78
78
event . preventDefault ( ) ;
79
79
this . props . onSave ( { } ) ;
80
80
return ;
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ export const metaDisplay = isMac ? "⌘" : "Ctrl";
5
5
6
6
export const meta = isMac ? "cmd" : "ctrl" ;
7
7
8
- export function isMetaKey (
8
+ export function isModKey (
9
9
event : KeyboardEvent | MouseEvent | SyntheticKeyboardEvent < >
10
10
) {
11
11
return isMac ? event . metaKey : event . ctrlKey ;
You can’t perform that action at this time.
0 commit comments