Revert "New composer: show markdown legend on focus"
This commit is contained in:
parent
71e13842b8
commit
1063da0ed1
3 changed files with 4 additions and 58 deletions
|
@ -226,21 +226,15 @@ export default class BasicMessageEditor extends React.Component {
|
|||
return this.getCaret().offset === this._lastTextLength;
|
||||
}
|
||||
|
||||
_onBlur = (event) => {
|
||||
_onBlur = () => {
|
||||
document.removeEventListener("selectionchange", this._onSelectionChange);
|
||||
if (this.props.onBlur) {
|
||||
this.props.onBlur(event);
|
||||
}
|
||||
}
|
||||
|
||||
_onFocus = (event) => {
|
||||
_onFocus = () => {
|
||||
document.addEventListener("selectionchange", this._onSelectionChange);
|
||||
// force to recalculate
|
||||
this._lastSelection = null;
|
||||
this._refreshLastCaretIfNeeded();
|
||||
if (this.props.onFocus) {
|
||||
this.props.onFocus(event);
|
||||
}
|
||||
}
|
||||
|
||||
_onSelectionChange = () => {
|
||||
|
|
|
@ -33,7 +33,6 @@ import sdk from '../../../index';
|
|||
import Modal from '../../../Modal';
|
||||
import { _t } from '../../../languageHandler';
|
||||
import ContentMessages from '../../../ContentMessages';
|
||||
import classNames from "classnames";
|
||||
|
||||
function addReplyToMessageContent(content, repliedToEvent, permalinkCreator) {
|
||||
const replyContent = ReplyThread.makeReplyMixIn(repliedToEvent);
|
||||
|
@ -88,7 +87,6 @@ export default class SendMessageComposer extends React.Component {
|
|||
|
||||
constructor(props, context) {
|
||||
super(props, context);
|
||||
this.state = {};
|
||||
this.model = null;
|
||||
this._editorRef = null;
|
||||
this.currentlyComposedEditorState = null;
|
||||
|
@ -332,18 +330,7 @@ export default class SendMessageComposer extends React.Component {
|
|||
}
|
||||
}
|
||||
|
||||
_onFocus = () => {
|
||||
this.setState({focused: true});
|
||||
}
|
||||
|
||||
_onBlur = () => {
|
||||
this.setState({focused: false});
|
||||
}
|
||||
|
||||
render() {
|
||||
const legendClasses = classNames("mx_SendMessageComposer_legend", {
|
||||
"mx_SendMessageComposer_legend_shown": this.state.focused,
|
||||
});
|
||||
return (
|
||||
<div className="mx_SendMessageComposer" onClick={this.focusComposer} onKeyDown={this._onKeyDown}>
|
||||
<div className="mx_SendMessageComposer_overlayWrapper">
|
||||
|
@ -356,16 +343,7 @@ export default class SendMessageComposer extends React.Component {
|
|||
label={this.props.placeholder}
|
||||
placeholder={this.props.placeholder}
|
||||
onChange={this._saveStoredEditorState}
|
||||
onFocus={this._onFocus}
|
||||
onBlur={this._onBlur}
|
||||
/>
|
||||
<div className={legendClasses}>
|
||||
<strong>**bold**</strong>
|
||||
<em>_italic_</em>
|
||||
<span><del>strikethrough</del></span>
|
||||
<code>`code`</code>
|
||||
<span>> quote</span>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue