Refactor view/controller logic between files, fix syntax & silly bugs.

This commit is contained in:
David Baker 2015-07-16 12:44:04 +01:00
parent e2757b3587
commit df790c1b54
5 changed files with 121 additions and 70 deletions

View file

@ -24,8 +24,6 @@ var dis = require("../../dispatcher");
var ComponentBroker = require("../../ComponentBroker");
var ServerConfig = ComponentBroker.get("molecules/ServerConfig");
module.exports = {
getInitialState: function() {
return {
@ -100,31 +98,6 @@ module.exports = {
});
},
componentForStep: function(step) {
switch (step) {
case 'choose_hs':
return (
<div>
<form onSubmit={this.onHSChosen}>
<ServerConfig ref="serverConfig" />
<input type="submit" value="Continue" />
</form>
</div>
);
// XXX: clearly these should be separate organisms
case 'stage_m.login.password':
return (
<div>
<form onSubmit={this.onUserPassEntered}>
<input ref="user" type="text" placeholder="username" /><br />
<input ref="pass" type="password" placeholder="password" /><br />
<input type="submit" value="Log in" />
</form>
</div>
);
}
},
showRegister: function(ev) {
ev.preventDefault();
dis.dispatch({