1
0
mirror of https://github.com/aclindsa/moneygo.git synced 2025-07-03 04:38:38 -04:00

Move to using npm/browserify to package everything

This means it now requires the Javascript to be compiled before it can
be run. This move also required a massive reorganization and lots of
debugging/fixups to make everything work properly again.
This commit is contained in:
2016-02-12 20:36:59 -05:00
parent 6856d617ec
commit 2621f64cc7
23 changed files with 790 additions and 1799 deletions

37
static/AccountCombobox.js Normal file
View File

@ -0,0 +1,37 @@
var React = require('react');
var Combobox = require('react-widgets').Combobox;
module.exports = React.createClass({
displayName: "AccountCombobox",
getDefaultProps: function() {
return {
includeRoot: true,
rootName: "New Top-level Account"
};
},
handleAccountChange: function(account) {
if (this.props.onChange != null &&
account.hasOwnProperty('AccountId') &&
(this.props.account_map.hasOwnProperty([account.AccountId]) ||
account.AccountId == -1)) {
this.props.onChange(account)
}
},
render: function() {
var accounts = getAccountDisplayList(this.props.accounts, this.props.includeRoot, this.props.rootName);
var className = "";
if (this.props.className)
className = this.props.className;
return (
<Combobox
data={accounts}
valueField='AccountId'
textField='Name'
defaultValue={this.props.value}
onChange={this.handleAccountChange}
ref="account"
className={className} />
);
}
});