Cleaned the inputs
This commit is contained in:
@ -43,6 +43,11 @@ const unsubscribe = store.subscribe(() => {
|
|||||||
console.log(store.getState());
|
console.log(store.getState());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
document.onreadystatechange = function () {
|
||||||
|
console.log("Ready state changed");
|
||||||
|
console.log(document.readyState);
|
||||||
|
}
|
||||||
|
|
||||||
//Start listening for key events
|
//Start listening for key events
|
||||||
Keyboard.register();
|
Keyboard.register();
|
||||||
|
|
||||||
|
@ -91,25 +91,26 @@ export default class Input extends React.Component {
|
|||||||
let clazzes = "o-input";
|
let clazzes = "o-input";
|
||||||
let innerClazzes = "o-input__inner";
|
let innerClazzes = "o-input__inner";
|
||||||
let style;
|
let style;
|
||||||
|
let props = Object.assign({}, this.props);
|
||||||
|
|
||||||
//Determining
|
//Determining
|
||||||
if(this.props.type) type = this.props.type;
|
if(props.type) type = props.type;
|
||||||
|
|
||||||
//Values
|
//Values
|
||||||
if(this.props.value) {
|
if(props.value) {
|
||||||
value = this.props.value;
|
value = props.value;
|
||||||
} else {
|
} else {
|
||||||
value = this.props.children;
|
value = props.children;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Style
|
//Style
|
||||||
if(this.props.style) {
|
if(props.style) {
|
||||||
style = this.props.style;
|
style = props.style;
|
||||||
} else if(this.props.error || this.props.danger) {
|
} else if(props.error || props.danger) {
|
||||||
style = "danger";
|
style = "danger";
|
||||||
} else if(this.props.warning) {
|
} else if(props.warning) {
|
||||||
style = "warning";
|
style = "warning";
|
||||||
} else if(this.props.primary) {
|
} else if(props.primary) {
|
||||||
style = "primary";
|
style = "primary";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -120,25 +121,28 @@ export default class Input extends React.Component {
|
|||||||
clazzes += " o-input--style-"+style;
|
clazzes += " o-input--style-"+style;
|
||||||
innerClazzes += " o-input--style-"+style+"__inner";
|
innerClazzes += " o-input--style-"+style+"__inner";
|
||||||
}
|
}
|
||||||
if(this.props.className) {
|
if(props.className) {
|
||||||
clazzes += " " + this.props.className;
|
clazzes += " " + props.className;
|
||||||
innerClazzes += " " + this.props.className + "-element";
|
innerClazzes += " " + props.className + "-element";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Clear junk props
|
||||||
|
delete props.manager;
|
||||||
|
|
||||||
//Now create the element
|
//Now create the element
|
||||||
let element;
|
let element;
|
||||||
|
|
||||||
//First we need to switch things like submit and reset
|
//First we need to switch things like submit and reset
|
||||||
if(type == "submit" || type == "reset" || type == "button") {
|
if(type == "submit" || type == "reset" || type == "button") {
|
||||||
return (<Button
|
return (<Button
|
||||||
{...this.props}
|
{...props}
|
||||||
className={this.props.className}
|
className={props.className}
|
||||||
value={this.state.value}
|
value={this.state.value}
|
||||||
/>);
|
/>);
|
||||||
|
|
||||||
} else if(type == "textarea") {
|
} else if(type == "textarea") {
|
||||||
element = (<textarea
|
element = (<textarea
|
||||||
{...this.props}
|
{...props}
|
||||||
className={innerClazzes}
|
className={innerClazzes}
|
||||||
onChange={this.onChange.bind(this)}
|
onChange={this.onChange.bind(this)}
|
||||||
onFocus={this.onFocus.bind(this)}
|
onFocus={this.onFocus.bind(this)}
|
||||||
@ -148,7 +152,7 @@ export default class Input extends React.Component {
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
element = (<ElementType
|
element = (<ElementType
|
||||||
{...this.props}
|
{...props}
|
||||||
onChange={this.onChange.bind(this)}
|
onChange={this.onChange.bind(this)}
|
||||||
onFocus={this.onFocus.bind(this)}
|
onFocus={this.onFocus.bind(this)}
|
||||||
onBlur={this.onBlur.bind(this)}
|
onBlur={this.onBlur.bind(this)}
|
||||||
|
@ -139,7 +139,7 @@ class ContactPage extends React.Component {
|
|||||||
placeholder={ Language.get("pages.contact.message.placeholder") }
|
placeholder={ Language.get("pages.contact.message.placeholder") }
|
||||||
rows="8"
|
rows="8"
|
||||||
className="p-contact-page__message"
|
className="p-contact-page__message"
|
||||||
required={ Forms.contact.message.required }e
|
required={ Forms.contact.message.required }
|
||||||
maxLength={ Forms.contact.message.maxLength }
|
maxLength={ Forms.contact.message.maxLength }
|
||||||
manager={ this.manager }
|
manager={ this.manager }
|
||||||
/>
|
/>
|
||||||
|
Reference in New Issue
Block a user