Change raw view to textarea for better performance

This commit is contained in:
Gregory Schier committed 2016-09-09 19:40:35 -07:00
1 parent 46d56804e6
commit dabf153e92
4 files changed
+27 -18

No files matched your search

+14 -12
View File
@@ -34,8 +34,7 @@ class RequestUrlBar extends Component {
const hasError = !url;
return (
<form className={classnames({'urlbar': true, 'urlbar--error': hasError})}
onSubmit={this._handleFormSubmit.bind(this)}>
<div className={classnames({'urlbar': true, 'urlbar--error': hasError})}>
<Dropdown>
<button type="button">
<div className="tall">
@@ -56,16 +55,19 @@ class RequestUrlBar extends Component {
))}
</ul>
</Dropdown>
<div className="form-control">
<input
ref={n => this.input = n}
type="text"
placeholder="https://api.myproduct.com/v1/users"
defaultValue={url}
onChange={e => this._handleUrlChange(e.target.value)}/>
</div>
<button type="submit" className="urlbar__send-button">Send</button>
</form>
<form onSubmit={this._handleFormSubmit.bind(this)}>
<div className="form-control">
<input
ref={n => this.input = n}
type="text"
placeholder="https://api.myproduct.com/v1/users"
defaultValue={url}
onClick={e => e.preventDefault()}
onChange={e => this._handleUrlChange(e.target.value)}/>
</div>
<button type="submit">Send</button>
</form>
</div>
);
}
}
+1
View File
@@ -62,6 +62,7 @@ class Dropdown extends Component {
return (
<div className={classes}
onClick={this._handleClick.bind(this)}
onMouseDown={e => e.preventDefault()}
ref={n => this._node = n}>
{this.props.children}
<div className="dropdown__backdrop"></div>
+4 -4
View File
@@ -62,10 +62,10 @@ class ResponseViewer extends Component {
);
default: // Raw
return (
<pre className="scrollable wide tall selectable monospace pad"
style={{fontSize: editorFontSize}}>
{body}
</pre>
<textarea className="scrollable wide tall selectable monospace pad no-resize"
defaultValue={body}
style={{fontSize: editorFontSize}}>
</textarea>
)
}
}
+8 -2
View File
@@ -54,7 +54,7 @@
min-width: 0;
}
.urlbar__send-button {
form button {
padding-right: @padding-md;
padding-left: @padding-md;
}
@@ -65,7 +65,13 @@
display: inline-block;
}
.urlbar__send-button,
form {
width: 100%;
display: flex;
flex-direction: row;
}
form button,
& > .dropdown {
height: 100%;