This commit is contained in:
Luke Barnard 2017-06-23 17:35:07 +01:00
parent 004d4828f8
commit 89afcfd897
7 changed files with 23 additions and 17 deletions

View file

@ -642,6 +642,10 @@ module.exports = React.createClass({
},
_renderUserInterfaceSettings: function() {
// TODO: this ought to be a separate component so that we don't need
// to rebind the onChange each time we render
const onChange = (e) =>
UserSettingsStore.setLocalSetting('autocompleteDelay', + e.target.value);
return (
<div>
<h3>{ _t("User Interface") }</h3>
@ -657,9 +661,7 @@ module.exports = React.createClass({
<input
type="number"
defaultValue={UserSettingsStore.getLocalSetting('autocompleteDelay', 200)}
onChange={
(e) => UserSettingsStore.setLocalSetting('autocompleteDelay', + e.target.value)
}
onChange={onChange}
/>
</td>
</tr>

View file

@ -201,7 +201,7 @@ export default class MessageComposerInput extends React.Component {
let {body, formatted_body} = payload.event.getContent();
formatted_body = formatted_body || escape(body);
if (formatted_body) {
let content = RichText.HTMLtoContentState(`<blockquote>${formatted_body}</blockquote>`);
let content = RichText.htmlToContentState(`<blockquote>${formatted_body}</blockquote>`);
if (!this.state.isRichtextEnabled) {
content = ContentState.createFromText(RichText.stateToMarkdown(content));
}
@ -350,7 +350,7 @@ export default class MessageComposerInput extends React.Component {
let contentState = null;
if (enabled) {
const md = new Markdown(this.state.editorState.getCurrentContent().getPlainText());
contentState = RichText.HTMLtoContentState(md.toHTML());
contentState = RichText.htmlToContentState(md.toHTML());
} else {
let markdown = RichText.stateToMarkdown(this.state.editorState.getCurrentContent());
if (markdown[markdown.length - 1] === '\n') {