1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-23 01:39:36 +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,7 +22,6 @@ 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"
@ -39,8 +38,6 @@ let AccordionListItemTable = React.createClass({
); );
})} })}
</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}>
</AccordionListItemTable>
<AccordionListItemTableToggle <AccordionListItemTableToggle
className="ascribe-accordion-list-table-toggle" className="ascribe-accordion-list-table-toggle"
onClick={this.loadFurtherEditions} onClick={this.loadFurtherEditions}
message={show && showExpandOption ? <p>Show me more</p> : ''} /> message={show && showExpandOption ? <span><span className="glyphicon glyphicon-option-horizontal" aria-hidden="true" style={{top: 3}}></span> Show me more</span> : ''} />
<AccordionListItemTableToggle
className="ascribe-accordion-list-table-toggle"
onClick={this.toggleTable}
message={show ? 'Hide all editions' : 'Show all editions'} />
</AccordionListItemTable>
</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;