Skip to content
Snippets Groups Projects
Commit 9f12fbde authored by David Sehnal's avatar David Sehnal
Browse files

mol-plugin: param help tweaks

parent 940b16eb
No related branches found
No related tags found
No related merge requests found
...@@ -83,7 +83,7 @@ export class ParamHelp<L extends LegendData> extends React.PureComponent<{ legen ...@@ -83,7 +83,7 @@ export class ParamHelp<L extends LegendData> extends React.PureComponent<{ legen
return <div className='msp-control-row msp-help-text'> return <div className='msp-control-row msp-help-text'>
<div> <div>
<div className='msp-help-description'><span className={`msp-icon msp-icon-help-circle`} />{description}</div> <div className='msp-help-description'><span className={`msp-icon msp-icon-help-circle`} />{description}</div>
<div className='msp-help-legend'>{Legend && <Legend legend={legend} />}</div> {Legend && <div className='msp-help-legend'><Legend legend={legend} /></div>}
</div> </div>
</div> </div>
} }
...@@ -123,13 +123,15 @@ export abstract class SimpleParam<P extends PD.Any> extends React.PureComponent< ...@@ -123,13 +123,15 @@ export abstract class SimpleParam<P extends PD.Any> extends React.PureComponent<
const help = this.props.param.help const help = this.props.param.help
? this.props.param.help(this.props.value) ? this.props.param.help(this.props.value)
: { description: this.props.param.description, legend: this.props.param.legend } : { description: this.props.param.description, legend: this.props.param.legend }
const desc = this.props.param.description;
const hasHelp = help.description || help.legend const hasHelp = help.description || help.legend
return <> return <>
<div className={this.className}> <div className={this.className}>
<span title={this.props.param.description}> <span title={desc}>
{label} {label}
{hasHelp && {hasHelp &&
<button className='msp-help msp-btn-link msp-btn-icon msp-control-group-expander' onClick={this.toggleExpanded} title={`${this.state.isExpanded ? 'Hide' : 'Show'} help`} <button className='msp-help msp-btn-link msp-btn-icon msp-control-group-expander' onClick={this.toggleExpanded}
title={desc || `${this.state.isExpanded ? 'Hide' : 'Show'} help`}
style={{ background: 'transparent', textAlign: 'left', padding: '0' }}> style={{ background: 'transparent', textAlign: 'left', padding: '0' }}>
<span className={`msp-icon msp-icon-help-circle-${this.state.isExpanded ? 'collapse' : 'expand'}`} /> <span className={`msp-icon msp-icon-help-circle-${this.state.isExpanded ? 'collapse' : 'expand'}`} />
</button> </button>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment