mirror of
https://github.com/ascribe/onion.git
synced 2024-12-23 01:39:36 +01:00
fix modal undefined bug
This commit is contained in:
parent
265a7573ce
commit
28a1c8f2d4
@ -14,16 +14,18 @@ let AclButtonList = React.createClass({
|
|||||||
this.setState(state);
|
this.setState(state);
|
||||||
},
|
},
|
||||||
|
|
||||||
componentWillMount() {
|
componentDidMount() {
|
||||||
UserActions.fetchCurrentUser();
|
|
||||||
UserStore.listen(this.onChange);
|
UserStore.listen(this.onChange);
|
||||||
|
UserActions.fetchCurrentUser();
|
||||||
},
|
},
|
||||||
|
|
||||||
componentDidUnmount() {
|
componentDidUnmount() {
|
||||||
UserStore.unlisten(this.onChange);
|
UserStore.unlisten(this.onChange);
|
||||||
},
|
},
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (<div className="text-center">
|
return (
|
||||||
|
<div className="text-center">
|
||||||
<AclButton
|
<AclButton
|
||||||
availableAcls={this.props.availableAcls}
|
availableAcls={this.props.availableAcls}
|
||||||
action="transfer"
|
action="transfer"
|
||||||
@ -48,7 +50,8 @@ let AclButtonList = React.createClass({
|
|||||||
editions={this.props.editions}
|
editions={this.props.editions}
|
||||||
currentUser={this.state.currentUser}
|
currentUser={this.state.currentUser}
|
||||||
handleSuccess={this.props.handleSuccess} />
|
handleSuccess={this.props.handleSuccess} />
|
||||||
</div>)
|
</div>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -25,7 +25,6 @@ let ResourceViewer = React.createClass({
|
|||||||
mixins: [InjectInHeadMixin],
|
mixins: [InjectInHeadMixin],
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
this.inject('http://antani.com');
|
|
||||||
},
|
},
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
@ -19,8 +19,7 @@ let ModalWrapper = React.createClass({
|
|||||||
title={this.props.title}
|
title={this.props.title}
|
||||||
editions={this.props.editions}
|
editions={this.props.editions}
|
||||||
currentUser={this.props.currentUser}
|
currentUser={this.props.currentUser}
|
||||||
handleSuccess={this.props.handleSuccess}
|
handleSuccess={this.props.handleSuccess}>
|
||||||
>
|
|
||||||
{this.props.children}
|
{this.props.children}
|
||||||
</ModalBody>
|
</ModalBody>
|
||||||
}>
|
}>
|
||||||
|
@ -22,8 +22,12 @@ let Header = React.createClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
UserStore.listen(this.onChange)
|
|
||||||
UserActions.fetchCurrentUser();
|
UserActions.fetchCurrentUser();
|
||||||
|
UserStore.listen(this.onChange)
|
||||||
|
},
|
||||||
|
|
||||||
|
componentDidUnmount() {
|
||||||
|
UserStore.unlisten(this.onChange)
|
||||||
},
|
},
|
||||||
|
|
||||||
onChange(state) {
|
onChange(state) {
|
||||||
@ -40,7 +44,7 @@ let Header = React.createClass({
|
|||||||
</a>
|
</a>
|
||||||
</Nav>
|
</Nav>
|
||||||
<Nav right>
|
<Nav right>
|
||||||
<DropdownButton eventKey={3} title={this.state.currentUser.username}>
|
<DropdownButton eventKey="1" title={this.state.currentUser.username}>
|
||||||
<MenuItem eventKey="1" href="/art/account_settings/">{getLangText('Account Settings')}</MenuItem>
|
<MenuItem eventKey="1" href="/art/account_settings/">{getLangText('Account Settings')}</MenuItem>
|
||||||
<li className="divider"></li>
|
<li className="divider"></li>
|
||||||
<MenuItem eventKey="2" href="/art/faq/">{getLangText('FAQ')}</MenuItem>
|
<MenuItem eventKey="2" href="/art/faq/">{getLangText('FAQ')}</MenuItem>
|
||||||
|
@ -7,8 +7,8 @@ import AlertDismissable from '../components/ascribe_forms/alert'
|
|||||||
export const FormMixin = {
|
export const FormMixin = {
|
||||||
getInitialState() {
|
getInitialState() {
|
||||||
return {
|
return {
|
||||||
submitted: false
|
submitted: false,
|
||||||
, errors: []
|
errors: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
import alt from '../alt';
|
import alt from '../alt';
|
||||||
import UserAction from '../actions/user_actions';
|
import UserActions from '../actions/user_actions';
|
||||||
|
|
||||||
|
|
||||||
class UserStore{
|
class UserStore {
|
||||||
constructor() {
|
constructor() {
|
||||||
this.currentUser = {};
|
this.currentUser = {};
|
||||||
this.bindActions(UserAction);
|
this.bindActions(UserActions);
|
||||||
}
|
}
|
||||||
|
|
||||||
onUpdateCurrentUser(user) {
|
onUpdateCurrentUser(user) {
|
||||||
|
Loading…
Reference in New Issue
Block a user