Skip to content

Commit

Permalink
Merge pull request #2886 from ccnmtl/ECON-624-range-cleanup
Browse files Browse the repository at this point in the history
Cleaned up the RangeEditor and Export buttons
  • Loading branch information
nikolas authored Dec 4, 2023
2 parents 20b0d76 + 03bb31c commit 8b9c050
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 42 deletions.
2 changes: 1 addition & 1 deletion media/js/src/buttons/ExportGraphButton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default class ExportGraphButton extends React.Component {
}
render() {
return (
<span className="ms-1">
<span className="ms-1 float-end">
Export as:
<a
className="btn btn-secondary btn-sm ms-1"
Expand Down
46 changes: 5 additions & 41 deletions media/js/src/form-components/RangeEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export default class RangeEditor extends React.Component {
<div className="col">
<div className="mb-2 input-group">
<button
className="btn btn-sm btn-primary ms-1 w-20"
className="btn btn-primary ms-1"
aria-label={'Decrease by ' + (Number(this.props.step) * 10 || 0.1)}
id={this.props.id}
data-id={this.props.dataId}
Expand All @@ -69,46 +69,10 @@ export default class RangeEditor extends React.Component {
this.props.min,
this.props.max)
}>
&lt;&lt;&lt;
&lt;&lt;
</button>
<button
className="btn btn-sm btn-info ms-1 w-20"
aria-label={'Decrease by ' + (Number(this.props.step) || 0.01)}
id={this.props.id}
data-id={this.props.dataId}
type="button"
onClick={this.props.handler}
disabled={this.props.disabled}
value={
btnStep(
this.props.value,
-1,
this.props.step || 0.01,
this.props.min,
this.props.max)
}>
&lt;
</button>
<button
className="btn btn-sm btn-info ms-1 w-20"
aria-label={'Increase by ' + (Number(this.props.step) || 0.01)}
id={this.props.id}
data-id={this.props.dataId}
type="button"
onClick={this.props.handler}
disabled={this.props.disabled}
value={
btnStep(
this.props.value,
1,
this.props.step || 0.01,
this.props.min,
this.props.max)
}>
&gt;
</button>
<button
className="btn btn-sm btn-primary ms-1 w-20"
className="btn btn-primary ms-1"
aria-label={'Increase by ' + (Number(this.props.step) * 10 || 0.1)}
id={this.props.id}
data-id={this.props.dataId}
Expand All @@ -123,7 +87,7 @@ export default class RangeEditor extends React.Component {
this.props.min,
this.props.max)
}>
&gt;&gt;&gt;
&gt;&gt;
</button>
<input
className="form-control ms-1"
Expand All @@ -132,7 +96,7 @@ export default class RangeEditor extends React.Component {
id={this.props.id}
data-id={this.props.dataId}
value={this.props.value}
step={Number(this.props.step) || 0.01}
step={Number(this.props.step) || 0.1}
onChange={this.props.handler}
disabled={this.props.disabled}
min={this.props.min}
Expand Down

0 comments on commit 8b9c050

Please sign in to comment.