1
0
mirror of https://github.com/ascribe/onion.git synced 2025-02-14 21:10:27 +01:00

add icons

This commit is contained in:
Tim Daubenschütz 2015-07-06 17:07:41 +02:00
parent 7863431727
commit 5ec54f4324
3 changed files with 33 additions and 32 deletions

View File

@ -22,25 +22,22 @@ let AccordionListItemTable = React.createClass({
render() { render() {
if(this.props.show && this.props.itemList) { if(this.props.show && this.props.itemList) {
return ( return (
<div className={this.props.className}> <Table
<Table responsive
responsive className="ascribe-table"
className="ascribe-table" columnList={this.props.columnList}
columnList={this.props.columnList} itemList={this.props.itemList}
itemList={this.props.itemList} changeOrder={this.props.changeOrder}
changeOrder={this.props.changeOrder} orderBy={this.props.orderBy}
orderBy={this.props.orderBy} orderAsc={this.props.orderAsc}>
orderAsc={this.props.orderAsc}> {this.props.itemList.map((item, i) => {
{this.props.itemList.map((item, i) => { return (
return ( <TableItem
<TableItem className="ascribe-table-item-selectable"
className="ascribe-table-item-selectable" key={i} />
key={i} /> );
); })}
})} </Table>
</Table>
{this.props.children}
</div>
); );
} else { } else {
return ( return (

View File

@ -170,9 +170,12 @@ let AccordionListItemTableEditions = React.createClass({
]; ];
return ( return (
<div> <div className={this.props.className}>
<AccordionListItemTableToggle
className="ascribe-accordion-list-table-toggle"
onClick={this.toggleTable}
message={show ? <span><span className="glyphicon glyphicon-menu-up" aria-hidden="true" style={{top: 2}}></span> Hide all editions</span> : <span><span className="glyphicon glyphicon-menu-down" aria-hidden="true" style={{top: 2}}></span> Show all editions </span>} />
<AccordionListItemTable <AccordionListItemTable
className={this.props.className}
parentId={this.props.parentId} parentId={this.props.parentId}
itemList={editionsForPiece} itemList={editionsForPiece}
columnList={columnList} columnList={columnList}
@ -180,16 +183,11 @@ let AccordionListItemTableEditions = React.createClass({
orderBy={orderBy} orderBy={orderBy}
orderAsc={orderAsc} orderAsc={orderAsc}
changeOrder={this.changeEditionListOrder}> changeOrder={this.changeEditionListOrder}>
<AccordionListItemTableToggle
className="ascribe-accordion-list-table-toggle"
onClick={this.loadFurtherEditions}
message={show && showExpandOption ? <p>Show me more</p> : ''} />
<AccordionListItemTableToggle
className="ascribe-accordion-list-table-toggle"
onClick={this.toggleTable}
message={show ? 'Hide all editions' : 'Show all editions'} />
</AccordionListItemTable> </AccordionListItemTable>
<AccordionListItemTableToggle
className="ascribe-accordion-list-table-toggle"
onClick={this.loadFurtherEditions}
message={show && showExpandOption ? <span><span className="glyphicon glyphicon-option-horizontal" aria-hidden="true" style={{top: 3}}></span> Show me more</span> : ''} />
</div> </div>
); );
} }

View File

@ -14,7 +14,13 @@ class EditionListStore {
onUpdateEditionList({pieceId, editionListOfPiece, page, pageSize, orderBy, orderAsc, count}) { onUpdateEditionList({pieceId, editionListOfPiece, page, pageSize, orderBy, orderAsc, count}) {
/*
Basically there are two modes an edition list can be updated.
1. The elements that have been requested from the server are not yet defined in the store => just assign them
2. The elements are already defined => merge current objects with the new ones from the server
*/
for(let i = 0; i < editionListOfPiece.length; i++) { for(let i = 0; i < editionListOfPiece.length; i++) {
// if editionList for a specific piece does not exist yet, // if editionList for a specific piece does not exist yet,
@ -38,10 +44,10 @@ class EditionListStore {
} }
/** /**
* orderBy and orderAsc are specific to a single list of editions * page, pageSize, orderBy, orderAsc and count are specific to a single list of editions
* therefore they need to be saved in relation to their parent-piece. * therefore they need to be saved in relation to their parent-piece.
* *
* Default values for both are set in the editon_list-actions. * Default values for both are set in the editon_list_actions.
*/ */
this.editionList[pieceId].page = page; this.editionList[pieceId].page = page;
this.editionList[pieceId].pageSize = pageSize; this.editionList[pieceId].pageSize = pageSize;