mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-10 21:47:06 +03:00
reduce returned variables
This commit is contained in:
@@ -437,7 +437,7 @@ class PreviewBar {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (changedData.scale) {
|
if (changedData.scale) {
|
||||||
const transformScale = (changedData.scale * changedData.scaleWidth + changedData.scalePosition) / progressBar.clientWidth;
|
const transformScale = (changedData.scale) / progressBar.clientWidth;
|
||||||
|
|
||||||
customChangedElement.style.transform =
|
customChangedElement.style.transform =
|
||||||
`scaleX(${Math.max(0, Math.min(1 - calculatedLeft,
|
`scaleX(${Math.max(0, Math.min(1 - calculatedLeft,
|
||||||
@@ -460,7 +460,7 @@ class PreviewBar {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private findLeftAndScale(selector: string, currentElement: HTMLElement, progressBar: HTMLElement):
|
private findLeftAndScale(selector: string, currentElement: HTMLElement, progressBar: HTMLElement):
|
||||||
{ left: number, leftPosition: number, scale: number, scalePosition: number, scaleWidth: number } {
|
{ left: number, scale: number } {
|
||||||
const sections = currentElement.parentElement.parentElement.parentElement.children;
|
const sections = currentElement.parentElement.parentElement.parentElement.children;
|
||||||
let currentWidth = 0;
|
let currentWidth = 0;
|
||||||
|
|
||||||
@@ -508,7 +508,10 @@ class PreviewBar {
|
|||||||
currentWidth += currentSectionWidth;
|
currentWidth += currentSectionWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
return { left: left + leftPosition, leftPosition, scale, scalePosition, scaleWidth };
|
return {
|
||||||
|
left: left + leftPosition,
|
||||||
|
scale: scale * scaleWidth + scalePosition
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private getPartialChapterSectionStyle(element: HTMLElement, param: string): number {
|
private getPartialChapterSectionStyle(element: HTMLElement, param: string): number {
|
||||||
|
|||||||
Reference in New Issue
Block a user