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

refactor edition-button

This commit is contained in:
Tim Daubenschütz 2015-05-27 09:56:26 +02:00
parent aa75b7d8bd
commit 58e284cbdf
4 changed files with 15 additions and 13 deletions

View File

@ -16,7 +16,7 @@
.ascribe-table-header-column { .ascribe-table-header-column {
display: table; display: table;
height:4em; height:3em;
} }
.ascribe-table-header-column > span { .ascribe-table-header-column > span {
@ -44,7 +44,7 @@
display: table; display: table;
font-family: 'Source Sans Pro'; font-family: 'Source Sans Pro';
font-size: 1.2em; font-size: 1.2em;
height:4em; height:3em;
} }
.ascribe-table-item-column > * { .ascribe-table-item-column > * {
@ -52,11 +52,10 @@
vertical-align: middle; vertical-align: middle;
} }
.btn-ascribe, .btn-ascribe:hover, .btn-ascribe:active, .btn-ascribe:focus {
background-color: rgba(2, 182, 163, 0.5);
border-color: rgba(2, 182, 163, 0.5);
}
.ascribe-table-item-selected { .ascribe-table-item-selected {
background-color: rgba(2, 182, 163, 0.5); background-color: rgba(2, 182, 163, 0.5);
} }
.ascribe-table-item-selectable {
cursor: default;
}

View File

@ -11,7 +11,8 @@ let TableItemSelectable = React.createClass({
propTypes: { propTypes: {
columnList: React.PropTypes.arrayOf(React.PropTypes.instanceOf(TableColumnContentModel)), columnList: React.PropTypes.arrayOf(React.PropTypes.instanceOf(TableColumnContentModel)),
columnContent: React.PropTypes.object, columnContent: React.PropTypes.object,
parentId: React.PropTypes.number parentId: React.PropTypes.number,
className: React.PropTypes.string
}, },
selectItem() { selectItem() {
@ -25,7 +26,7 @@ let TableItemSelectable = React.createClass({
return ( return (
<TableItem <TableItem
classNames={tableItemClasses} classNames={tableItemClasses + ' ' + this.props.className}
columnList={this.props.columnList} columnList={this.props.columnList}
columnContent={this.props.columnContent} columnContent={this.props.columnContent}
onClick={this.selectItem}> onClick={this.selectItem}>

View File

@ -74,6 +74,7 @@ let TableItemSubtable = React.createClass({
{this.state.editionList[this.props.columnContent.id].map((edition, i) => { {this.state.editionList[this.props.columnContent.id].map((edition, i) => {
return ( return (
<TableItemSelectable <TableItemSelectable
className="ascribe-table-item-selectable"
selectItem={this.selectItem} selectItem={this.selectItem}
parentId={this.props.columnContent.id} parentId={this.props.columnContent.id}
key={i}> key={i}>
@ -93,9 +94,10 @@ let TableItemSubtable = React.createClass({
<TableItemWrapper <TableItemWrapper
columnList={this.props.columnList} columnList={this.props.columnList}
columnContent={this.props.columnContent} columnContent={this.props.columnContent}
columnWidth={10}></TableItemWrapper> columnWidth={12}>
<div className="col-xs-2 col-sm-2 col-md-2 col-lg-2 ascribe-table-item-column"> </TableItemWrapper>
<TableItemSubtableButton content="Editions" onClick={this.loadEditionList}> <div className="col-xs-1 col-sm-1 col-md-1 col-lg-1 ascribe-table-item-column">
<TableItemSubtableButton content="+" onClick={this.loadEditionList}>
</TableItemSubtableButton> </TableItemSubtableButton>
</div> </div>
</div> </div>

View File

@ -10,7 +10,7 @@ let TableItemSubtableButton = React.createClass({
render() { render() {
return ( return (
<span> <span>
<button type="button" className="btn btn-ascribe btn-primary btn-sm" onClick={this.props.onClick}> <button type="button" className="btn btn-default btn-sm ascribe-table-expand-button" onClick={this.props.onClick}>
{this.props.content} {this.props.content}
</button> </button>
</span> </span>