mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-22 12:21:13 +00:00
Merge branch 'main' into 1078-language-select-disable-warning
This commit is contained in:
commit
cd6a2f47a1
2 changed files with 14 additions and 1 deletions
|
@ -148,6 +148,7 @@ export class MarkdownTextArea extends Component<
|
||||||
value={this.state.content}
|
value={this.state.content}
|
||||||
onInput={linkEvent(this, this.handleContentChange)}
|
onInput={linkEvent(this, this.handleContentChange)}
|
||||||
onPaste={linkEvent(this, this.handleImageUploadPaste)}
|
onPaste={linkEvent(this, this.handleImageUploadPaste)}
|
||||||
|
onKeyDown={linkEvent(this, this.handleKeyBinds)}
|
||||||
required
|
required
|
||||||
disabled={this.isDisabled}
|
disabled={this.isDisabled}
|
||||||
rows={2}
|
rows={2}
|
||||||
|
@ -429,6 +430,18 @@ export class MarkdownTextArea extends Component<
|
||||||
i.contentChange();
|
i.contentChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Keybind handler
|
||||||
|
handleKeyBinds(i: MarkdownTextArea, event: KeyboardEvent) {
|
||||||
|
if (event.ctrlKey) {
|
||||||
|
switch (event.key) {
|
||||||
|
case "k": {
|
||||||
|
// Currently only one case but will support further keybinds
|
||||||
|
i.handleInsertLink(i, event);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
handlePreviewToggle(i: MarkdownTextArea, event: any) {
|
handlePreviewToggle(i: MarkdownTextArea, event: any) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
i.setState({ previewMode: !i.state.previewMode });
|
i.setState({ previewMode: !i.state.previewMode });
|
||||||
|
|
|
@ -317,7 +317,7 @@ export class Profile extends Component<
|
||||||
{this.getRadio(PersonDetailsView.Overview)}
|
{this.getRadio(PersonDetailsView.Overview)}
|
||||||
{this.getRadio(PersonDetailsView.Comments)}
|
{this.getRadio(PersonDetailsView.Comments)}
|
||||||
{this.getRadio(PersonDetailsView.Posts)}
|
{this.getRadio(PersonDetailsView.Posts)}
|
||||||
{this.getRadio(PersonDetailsView.Saved)}
|
{this.amCurrentUser && this.getRadio(PersonDetailsView.Saved)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue