1
0
mirror of https://github.com/ascribe/onion.git synced 2025-01-05 11:25:09 +01:00

fix search bug

This commit is contained in:
Tim Daubenschütz 2015-06-05 15:17:35 +02:00
parent 7f82d49278
commit 3a812e531d
4 changed files with 20 additions and 11 deletions

View File

@ -1,3 +1,5 @@
'use strict';
import React from 'react'; import React from 'react';
import UserActions from '../../actions/user_actions'; import UserActions from '../../actions/user_actions';
@ -6,12 +8,15 @@ import UserStore from '../../stores/user_store';
import AclButton from '../ascribe_buttons/acl_button'; import AclButton from '../ascribe_buttons/acl_button';
let AclButtonList = React.createClass({ let AclButtonList = React.createClass({
getInitialState() { propTypes: {
return UserStore.getState(); availableAcls: React.PropTypes.array,
editions: React.PropTypes.array,
currentUser: React.PropTypes.object,
handleSuccess: React.PropTypes.func
}, },
onChange(state) { getInitialState() {
this.setState(state); return UserStore.getState();
}, },
componentDidMount() { componentDidMount() {
@ -19,10 +24,14 @@ let AclButtonList = React.createClass({
UserActions.fetchCurrentUser(); UserActions.fetchCurrentUser();
}, },
componentDidUnmount() { componentWillUnmount() {
UserStore.unlisten(this.onChange); UserStore.unlisten(this.onChange);
}, },
onChange(state) {
this.setState(state);
},
render() { render() {
return ( return (
<div className="text-center"> <div className="text-center">

View File

@ -32,7 +32,7 @@ let PieceListToolbar = React.createClass({
searchFor() { searchFor() {
let searchTerm = this.refs.search.getInputDOMNode().value; let searchTerm = this.refs.search.getInputDOMNode().value;
PieceListActions.fetchPieceList(this.state.page, this.pageSize, searchTerm, this.state.orderBy, this.state.orderAsc); PieceListActions.fetchPieceList(this.state.page, this.state.pageSize, searchTerm, this.state.orderBy, this.state.orderAsc);
}, },
render() { render() {

View File

@ -30,7 +30,7 @@ let Edition = React.createClass({
let extraData = null; let extraData = null;
if (this.props.edition.digital_work.encoding_urls) { if (this.props.edition.digital_work.encoding_urls) {
extraData = this.props.edition.digital_work.encoding_urls.map(e => { return { url: e.url, type: e.label } }); extraData = this.props.edition.digital_work.encoding_urls.map(e => { return { url: e.url, type: e.label }; });
} }
let bitcoinIdValue = ( let bitcoinIdValue = (