diff --git a/public/index.jsx b/public/index.jsx index a53fa21..362ba41 100644 --- a/public/index.jsx +++ b/public/index.jsx @@ -43,6 +43,11 @@ const unsubscribe = store.subscribe(() => { console.log(store.getState()); }); +document.onreadystatechange = function () { + console.log("Ready state changed"); + console.log(document.readyState); +} + //Start listening for key events Keyboard.register(); diff --git a/public/input/Input.jsx b/public/input/Input.jsx index 84907d0..d0e3603 100644 --- a/public/input/Input.jsx +++ b/public/input/Input.jsx @@ -91,25 +91,26 @@ export default class Input extends React.Component { let clazzes = "o-input"; let innerClazzes = "o-input__inner"; let style; + let props = Object.assign({}, this.props); //Determining - if(this.props.type) type = this.props.type; + if(props.type) type = props.type; //Values - if(this.props.value) { - value = this.props.value; + if(props.value) { + value = props.value; } else { - value = this.props.children; + value = props.children; } //Style - if(this.props.style) { - style = this.props.style; - } else if(this.props.error || this.props.danger) { + if(props.style) { + style = props.style; + } else if(props.error || props.danger) { style = "danger"; - } else if(this.props.warning) { + } else if(props.warning) { style = "warning"; - } else if(this.props.primary) { + } else if(props.primary) { style = "primary"; } @@ -120,25 +121,28 @@ export default class Input extends React.Component { clazzes += " o-input--style-"+style; innerClazzes += " o-input--style-"+style+"__inner"; } - if(this.props.className) { - clazzes += " " + this.props.className; - innerClazzes += " " + this.props.className + "-element"; + if(props.className) { + clazzes += " " + props.className; + innerClazzes += " " + props.className + "-element"; } + //Clear junk props + delete props.manager; + //Now create the element let element; //First we need to switch things like submit and reset if(type == "submit" || type == "reset" || type == "button") { return (