mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-25 09:52:19 +01:00
boolean debug
This commit is contained in:
parent
1597c5f4b3
commit
334b6f46e0
3 changed files with 30 additions and 15 deletions
|
|
@ -16,13 +16,18 @@
|
|||
}
|
||||
|
||||
& .section {
|
||||
& .caption {
|
||||
&.closable {
|
||||
cursor: pointer;
|
||||
|
||||
&.closable > .caption {
|
||||
cursor: pointer;
|
||||
& .title {
|
||||
&:hover {
|
||||
color: blue;
|
||||
color: blue;
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
& .caption {
|
||||
&.accent {
|
||||
background-color: rgb(255, 244, 244);
|
||||
font-weight: bold;
|
||||
|
|
|
|||
|
|
@ -12,12 +12,14 @@ export default class Section extends React.PureComponent {
|
|||
}
|
||||
|
||||
render() {
|
||||
let {name, tabs, closable, defaultClosed, accent, children, captionStyles} = this.props;
|
||||
let {name, tabs, closable, defaultClosed, accent, children, captionStyles, controls} = this.props;
|
||||
let closed = closable && (this.state.closed || defaultClosed);
|
||||
return <div className={cx('section', {closable, closed})} style={{paddingLeft: tabs}}>
|
||||
<div className={cx('caption', {accent}, captionStyles)} >
|
||||
{closable && <i className={'fa fa-fw fa-caret-' + (closed ? 'right': 'down')} />} {name}</div>
|
||||
{children}
|
||||
<span className='title'>{closable && <i className={'fa fa-caret-' + (closed ? 'right': 'down')} />} {name}</span>
|
||||
<span className='control'>{controls}</span>
|
||||
</div>
|
||||
{children}
|
||||
</div>;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,18 +1,26 @@
|
|||
import React from 'react';
|
||||
import Section from "./section";
|
||||
|
||||
export default class ShellExplorer extends React.PureComponent {
|
||||
|
||||
render() {
|
||||
let {shell} = this.props;
|
||||
|
||||
let faceControls = <span>
|
||||
<i className='fa fa-fw fa-eye' onClick={alert}/>
|
||||
<i className='fa fa-fw fa-eye-slash' onClick={alert}/>
|
||||
</span>;
|
||||
|
||||
return <div className='shell-explorer'>
|
||||
<div className='caption'>faces</div>
|
||||
{shell.faces.map(face => <div>
|
||||
<div className='caption'>face {face.refId}</div>
|
||||
{mapIterator(face.edges, e => <div>
|
||||
edge: {e.refId}
|
||||
</div>)}
|
||||
</div>)
|
||||
}
|
||||
|
||||
<Section name='faces' closable>
|
||||
{shell.faces.map(face => <Section name={`face ${face.refId}`} tabs='0.5em' closable defaultClosed={true} controls={faceControls}>
|
||||
{mapIterator(face.edges, e => <div>
|
||||
edge: {e.refId}
|
||||
</div>)}
|
||||
</Section>)
|
||||
}
|
||||
</Section>
|
||||
</div>;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue