1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-23 01:39:36 +01:00

put architecture for transcluding TableItem in place

This commit is contained in:
Tim Daubenschütz 2015-05-22 18:41:15 +02:00
parent 4c0e7992f4
commit 0927d021c9
4 changed files with 23 additions and 4 deletions

View File

@ -9,7 +9,7 @@ class EditionListActions {
); );
} }
fetchList(pieceId) { fetchEditionList(pieceId) {
EditionListFetcher EditionListFetcher
.fetch(pieceId) .fetch(pieceId)
.then((res) => { .then((res) => {

View File

@ -9,7 +9,7 @@ let Table = React.createClass({
propTypes: { propTypes: {
columnList: React.PropTypes.arrayOf(React.PropTypes.instanceOf(TableColumnContentModel)), columnList: React.PropTypes.arrayOf(React.PropTypes.instanceOf(TableColumnContentModel)),
changeOrder: React.PropTypes.func.isRequired changeOrder: React.PropTypes.func // turn isRequired on again after editions order implemented
}, },
renderChildren() { renderChildren() {

View File

@ -14,6 +14,25 @@ let TableItemSubtable = React.createClass({
columnContent: React.PropTypes.object columnContent: React.PropTypes.object
}, },
getInitialState() {
return {
'open': false
};
},
onChange(state) {
this.setState(state);
},
componentDidMount() {
this.props.store.listen(this.onChange);
},
loadEditionList() {
console.log(this.props);
//this.props.actions.actions.fetchEditionList();
},
calcColumnClasses(list, i) { calcColumnClasses(list, i) {
let bootstrapClasses = ['col-xs-', 'col-sm-', 'col-md-', 'col-lg-']; let bootstrapClasses = ['col-xs-', 'col-sm-', 'col-md-', 'col-lg-'];
@ -49,7 +68,7 @@ let TableItemSubtable = React.createClass({
<div className="row"> <div className="row">
{calcColumnElementContent()} {calcColumnElementContent()}
<div className="col-xs-2 col-sm-2 col-md-2 col-lg-2 ascribe-table-item-column"> <div className="col-xs-2 col-sm-2 col-md-2 col-lg-2 ascribe-table-item-column">
<TableItemSubtableButton content="Editions"> <TableItemSubtableButton content="Editions" onClick={this.loadEditionList}>
</TableItemSubtableButton> </TableItemSubtableButton>
</div> </div>
</div> </div>

View File

@ -61,7 +61,7 @@ let PieceList = React.createClass({
} }
}}> }}>
<Table columnList={columnList} changeOrder={this.tableChangeOrder}> <Table columnList={columnList} changeOrder={this.tableChangeOrder}>
<TableItemSubtable></TableItemSubtable> <TableItemSubtable store={EditionListStore} actions={EditionListActions}></TableItemSubtable>
</Table> </Table>
<Pagination currentPage={this.props.query.page} goToPage={this.paginationGoToPage} /> <Pagination currentPage={this.props.query.page} goToPage={this.paginationGoToPage} />
</AltContainer> </AltContainer>