Skip to content

Commit 6bbb4a1

Browse files
author
Emmanouil Konstantinidis
committed
Input types
1 parent ebcdff8 commit 6bbb4a1

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

rest_framework_docs/static/rest_framework_docs/js/components/helpers/input.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ var Input = React.createClass({
1616
</label>
1717
<div className="col-sm-8">
1818
<input
19-
type="text"
19+
type={this.props.type}
2020
className="form-control input-sm"
2121
id={this.props.name}
2222
placeholder={this.props.placeholder}

rest_framework_docs/static/rest_framework_docs/js/components/request/field-url.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ var FieldUrl = React.createClass({
2626
<div>
2727
<Header title='API Endpoint' />
2828
<Input
29+
type='text'
2930
name='Url Endpoint'
3031
value={this.state.url}
3132
placeholder='Endpoint Url'

rest_framework_docs/static/rest_framework_docs/js/components/request/fields-data.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ var FieldsData = React.createClass({
1111
_renderFields: function () {
1212
return this.props.fields.map(function (field, key) {
1313
var value = this.props.data[field.name];
14+
var type = field.name == 'password' ? 'password' : 'text';
1415
return (
1516
<Input
1617
key={key}
18+
type={type}
1719
name={field.name}
1820
value={value}
1921
placeholder={field.type}

rest_framework_docs/static/rest_framework_docs/js/dist.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32359,7 +32359,7 @@ var Input = React.createClass({
3235932359
"div",
3236032360
{ className: "col-sm-8" },
3236132361
React.createElement("input", {
32362-
type: "text",
32362+
type: this.props.type,
3236332363
className: "form-control input-sm",
3236432364
id: this.props.name,
3236532365
placeholder: this.props.placeholder,
@@ -32597,6 +32597,7 @@ var FieldUrl = React.createClass({
3259732597
null,
3259832598
React.createElement(Header, { title: 'API Endpoint' }),
3259932599
React.createElement(Input, {
32600+
type: 'text',
3260032601
name: 'Url Endpoint',
3260132602
value: this.state.url,
3260232603
placeholder: 'Endpoint Url',
@@ -32624,8 +32625,10 @@ var FieldsData = React.createClass({
3262432625
_renderFields: function _renderFields() {
3262532626
return this.props.fields.map(function (field, key) {
3262632627
var value = this.props.data[field.name];
32628+
var type = field.name == 'password' ? 'password' : 'text';
3262732629
return React.createElement(Input, {
3262832630
key: key,
32631+
type: type,
3262932632
name: field.name,
3263032633
value: value,
3263132634
placeholder: field.type,

0 commit comments

Comments
 (0)