Remove now unused code
This commit is contained in:
parent
6cb59f7071
commit
6e4c3bfe56
1 changed files with 17 additions and 26 deletions
|
@ -702,8 +702,6 @@ export default class MessageComposerInput extends React.Component {
|
||||||
this.direction = 'Previous';
|
this.direction = 'Previous';
|
||||||
} else if (ev.keyCode === KeyCode.RIGHT) {
|
} else if (ev.keyCode === KeyCode.RIGHT) {
|
||||||
this.direction = 'Next';
|
this.direction = 'Next';
|
||||||
} else {
|
|
||||||
this.direction = '';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (ev.keyCode) {
|
switch (ev.keyCode) {
|
||||||
|
@ -1197,35 +1195,28 @@ export default class MessageComposerInput extends React.Component {
|
||||||
};
|
};
|
||||||
|
|
||||||
onVerticalArrow = (e, up) => {
|
onVerticalArrow = (e, up) => {
|
||||||
if (e.ctrlKey || e.shiftKey || e.altKey || e.metaKey) {
|
if (e.ctrlKey || e.shiftKey || e.altKey || e.metaKey) return;
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Select history only if we are not currently auto-completing
|
// Select history
|
||||||
if (this.autocomplete.state.completionList.length === 0) {
|
const selection = this.state.editorState.selection;
|
||||||
const selection = this.state.editorState.selection;
|
|
||||||
|
|
||||||
// selection must be collapsed
|
// selection must be collapsed
|
||||||
if (!selection.isCollapsed) return;
|
if (!selection.isCollapsed) return;
|
||||||
const document = this.state.editorState.document;
|
const document = this.state.editorState.document;
|
||||||
|
|
||||||
// and we must be at the edge of the document (up=start, down=end)
|
// and we must be at the edge of the document (up=start, down=end)
|
||||||
if (up) {
|
if (up) {
|
||||||
if (!selection.anchor.isAtStartOfNode(document)) return;
|
if (!selection.anchor.isAtStartOfNode(document)) return;
|
||||||
|
|
||||||
const editEvent = findEditableEvent(this.props.room, false);
|
const editEvent = findEditableEvent(this.props.room, false);
|
||||||
if (editEvent) {
|
if (editEvent) {
|
||||||
// We're selecting history, so prevent the key event from doing anything else
|
// We're selecting history, so prevent the key event from doing anything else
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
dis.dispatch({
|
dis.dispatch({
|
||||||
action: 'edit_event',
|
action: 'edit_event',
|
||||||
event: editEvent,
|
event: editEvent,
|
||||||
});
|
});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
this.moveAutocompleteSelection(up);
|
|
||||||
e.preventDefault();
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue