Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 8cb086e

Browse files
committed
use constants for keycodes in RTE
1 parent 2606ea9 commit 8cb086e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/components/views/rooms/MessageComposerInput.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ import * as RichText from '../../../RichText';
4646

4747
const TYPING_USER_TIMEOUT = 10000, TYPING_SERVER_TIMEOUT = 30000;
4848

49+
const KEY_M = 77;
50+
4951
// FIXME Breaks markdown with multiple paragraphs, since it only strips first and last <p>
5052
function mdownToHtml(mdown) {
5153
var html = marked(mdown) || "";
@@ -85,7 +87,7 @@ export default class MessageComposerInput extends React.Component {
8587

8688
static getKeyBinding(e: SyntheticKeyboardEvent): string {
8789
// C-m => Toggles between rich text and markdown modes
88-
if(e.keyCode == 77 && KeyBindingUtil.isCtrlKeyCommand(e)) {
90+
if(e.keyCode == KEY_M && KeyBindingUtil.isCtrlKeyCommand(e)) {
8991
return 'toggle-mode';
9092
}
9193

0 commit comments

Comments
 (0)