mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-07 12:07:11 +03:00
Now handeling deltaY=0 and shrunk down code
This commit is contained in:
@@ -251,8 +251,8 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
|
||||
const step = 0.01;
|
||||
const sponsorTimeEdits = this.state.sponsorTimeEdits;
|
||||
let timeAsNumber = utils.getFormattedTimeToSeconds(this.state.sponsorTimeEdits[index]);
|
||||
if (timeAsNumber !== null) {
|
||||
if (this.isWheelScrollingUp(e)){
|
||||
if (timeAsNumber !== null && e.deltaY != 0) {
|
||||
if (e.deltaY < 0){
|
||||
timeAsNumber += step;
|
||||
}else if (timeAsNumber >= step){
|
||||
timeAsNumber -= step;
|
||||
@@ -266,17 +266,6 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
|
||||
}
|
||||
}
|
||||
|
||||
isWheelScrollingUp(e: React.WheelEvent): boolean {
|
||||
console.log("wheelUpOrDown")
|
||||
if (e.deltaY < 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if (e.deltaY > 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
getCategoryOptions(): React.ReactElement[] {
|
||||
const elements = [(
|
||||
<option value={DEFAULT_CATEGORY}
|
||||
|
||||
Reference in New Issue
Block a user