1
0
mirror of https://github.com/ascribe/onion.git synced 2025-01-03 10:25:08 +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 UserActions from '../../actions/user_actions';
@ -6,12 +8,15 @@ import UserStore from '../../stores/user_store';
import AclButton from '../ascribe_buttons/acl_button';
let AclButtonList = React.createClass({
getInitialState() {
return UserStore.getState();
propTypes: {
availableAcls: React.PropTypes.array,
editions: React.PropTypes.array,
currentUser: React.PropTypes.object,
handleSuccess: React.PropTypes.func
},
onChange(state) {
this.setState(state);
getInitialState() {
return UserStore.getState();
},
componentDidMount() {
@ -19,10 +24,14 @@ let AclButtonList = React.createClass({
UserActions.fetchCurrentUser();
},
componentDidUnmount() {
componentWillUnmount() {
UserStore.unlisten(this.onChange);
},
onChange(state) {
this.setState(state);
},
render() {
return (
<div className="text-center">

View File

@ -32,7 +32,7 @@ let PieceListToolbar = React.createClass({
searchFor() {
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() {

View File

@ -30,7 +30,7 @@ let Edition = React.createClass({
let extraData = null;
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 = (