Bind slider handel function

This commit is contained in:
2022-05-01 13:03:49 +08:00
parent a0547095e2
commit 53ae625c92
4 changed files with 43 additions and 3 deletions
+1 -1
View File
@@ -30,7 +30,7 @@ div.recorder-root {
span.ms-Slider-inactive {
height: 3px;
animation: none;
transition: none;
}
}
+22 -2
View File
@@ -14,6 +14,7 @@ interface IRecorderProps {
allTime?: number;
currentTime?: number;
action?: () => void;
valueChange?: (value: number) => any;
}
class Recorder extends Component<IRecorderProps> {
@@ -85,19 +86,38 @@ class Recorder extends Component<IRecorderProps> {
max={this.props.allFrame}
className={"recorder-slider" + (isSliderDisable ? " disable" : "")}
showValue={false}
onChange={(value) => {
if (this.props.valueChange && !isSliderDisable) {
this.props.valueChange(value);
}
}}
/>
<div className="recorder-content">
<div className="time-view">
{this.getRecordInfo()}
</div>
<div className="ctrl-button">
<div className={"ctrl-action" + (isJumpDisable ? " disable" : "")}>
<div
className={"ctrl-action" + (isJumpDisable ? " disable" : "")}
onClick={() => {
if (this.props.valueChange && !isJumpDisable && this.props.currentFrame !== undefined) {
this.props.valueChange(this.props.currentFrame - 1);
}
}}
>
<Icon iconName="Back"/>
</div>
<div className="ctrl-action ctrl-action-main" onClick={this.props.action}>
<Icon iconName={this.getActionIcon()}/>
</div>
<div className={"ctrl-action" + (isJumpDisable ? " disable" : "")}>
<div
className={"ctrl-action" + (isJumpDisable ? " disable" : "")}
onClick={() => {
if (this.props.valueChange && !isJumpDisable && this.props.currentFrame !== undefined) {
this.props.valueChange(this.props.currentFrame + 1);
}
}}
>
<Icon iconName="Forward"/>
</div>
</div>