Skip to content

Commit 65124c5

Browse files
committed
Fix power limit sliders +/- buttons & extend missing event workaround
1 parent 605a96a commit 65124c5

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

src/ng-app/app/profile-details-edit/profile-details-edit.component.html

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -443,20 +443,14 @@ <h4 i18n="@@cProfMgrDetailsODMTDPLabel" *ngIf="compat.hasODMPowerLimitControl">C
443443
<content class="value" [hidden]="!editProfile">{{ inputODMPowerLimit.value }} W</content>
444444
<button mat-icon-button color="primary"
445445
[hidden]="!editProfile"
446-
(mousedown)="
447-
buttonRepeatDown(modifySliderInputFunc(getODMTDPControls[i], -1, sliderODMPowerLimitMinValue(i), sliderODMPowerLimitMaxValue(i)));
448-
sliderODMPowerLimitChange(i);
449-
getODMTDPControls[i].markAsDirty();"
446+
(mousedown)="buttonRepeatDown(modifySliderInputFunc(getODMTDPControls[i], -1, sliderODMPowerLimitMinValue(i), sliderODMPowerLimitMaxValue(i), sliderODMPowerLimitChange, i))"
450447
(mouseup)="buttonRepeatUp()"
451448
(mouseleave)="buttonRepeatUp()">
452449
<mat-icon>remove</mat-icon>
453450
</button>
454451
<button mat-icon-button color="primary"
455452
[hidden]="!editProfile"
456-
(mousedown)="
457-
buttonRepeatDown(modifySliderInputFunc(getODMTDPControls[i], +1, sliderODMPowerLimitMinValue(i), sliderODMPowerLimitMaxValue(i)));
458-
sliderODMPowerLimitChange(i);
459-
getODMTDPControls[i].markAsDirty();"
453+
(mousedown)="buttonRepeatDown(modifySliderInputFunc(getODMTDPControls[i], +1, sliderODMPowerLimitMinValue(i), sliderODMPowerLimitMaxValue(i), sliderODMPowerLimitChange, i))"
460454
(mouseup)="buttonRepeatUp()"
461455
(mouseleave)="buttonRepeatUp()">
462456
<mat-icon>add</mat-icon>

src/ng-app/app/profile-details-edit/profile-details-edit.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,14 +516,14 @@ export class ProfileDetailsEditComponent implements OnInit, OnDestroy {
516516
clearInterval(this.buttonRepeatTimer);
517517
}
518518

519-
public modifySliderInputFunc(slider, offset: number, min: number, max: number, hackTrigger?) {
519+
public modifySliderInputFunc(slider, offset: number, min: number, max: number, hackTrigger?, hackArg?) {
520520
return () => {
521521
this.modifySliderInput(slider, offset, min, max);
522522
/*
523523
* Note: hackTrigger added as workaround for change event not triggering on
524524
* setValue, should be removed as soon as it works again.
525525
*/
526-
if (hackTrigger !== undefined) { hackTrigger.call(this); }
526+
if (hackTrigger !== undefined) { hackTrigger.call(this, hackArg); }
527527
}
528528
}
529529

0 commit comments

Comments
 (0)