From 3f2bccebbbd96d8bb2976c92c662f09e3c6d7267 Mon Sep 17 00:00:00 2001 From: David Steinacher Date: Tue, 14 Jan 2025 13:58:35 +0100 Subject: [PATCH 1/2] remove the caret from the SeekbarLabel --- src/scss/components/labels/_seekbarlabel.scss | 14 -------------- src/ts/components/seekbar/SeekBarLabel.ts | 9 +-------- 2 files changed, 1 insertion(+), 22 deletions(-) diff --git a/src/scss/components/labels/_seekbarlabel.scss b/src/scss/components/labels/_seekbarlabel.scss index 20be2ee56..01df58de8 100644 --- a/src/scss/components/labels/_seekbarlabel.scss +++ b/src/scss/components/labels/_seekbarlabel.scss @@ -26,20 +26,6 @@ padding-right: 1em; } - // bottom arrow from http://www.cssarrowplease.com/ - .#{$prefix}-seekbar-label-caret { - border: solid transparent; - border-color: transparent; - border-top-color: $color-primary; - border-width: .5em; - height: 0; - margin-left: -.5em; - pointer-events: none; - position: absolute; - top: 100%; - width: 0; - } - .#{$prefix}-seekbar-label-inner { border: solid $color-primary .0625em; border-radius: .5em; diff --git a/src/ts/components/seekbar/SeekBarLabel.ts b/src/ts/components/seekbar/SeekBarLabel.ts index f6a251302..234dc2a20 100644 --- a/src/ts/components/seekbar/SeekBarLabel.ts +++ b/src/ts/components/seekbar/SeekBarLabel.ts @@ -37,7 +37,6 @@ export class SeekBarLabel extends Container { private player: PlayerAPI; private uiManager: UIInstanceManager; private readonly container: Container; - private readonly caret: Label; constructor(config: SeekBarLabelConfig = {}) { super(config); @@ -58,11 +57,9 @@ export class SeekBarLabel extends Container { cssClass: 'seekbar-label-inner', }); - this.caret = new Label({ cssClasses: ['seekbar-label-caret'] }); - this.config = this.mergeConfig(config, { cssClass: 'ui-seekbar-label', - components: [this.container, this.caret], + components: [this.container], hidden: true, }, this.config); } @@ -151,10 +148,6 @@ export class SeekBarLabel extends Container { if (preventOverflowOffset !== 0) { this.getDomElement().css('left', seekPositionPx - preventOverflowOffset + 'px'); - - this.caret.getDomElement().css('transform', `translateX(${preventOverflowOffset}px)`); - } else { - this.caret.getDomElement().css('transform', null); } } From 0429da041b9d987aa4ab661f696740cc1b0bc470 Mon Sep 17 00:00:00 2001 From: David Steinacher Date: Tue, 14 Jan 2025 14:02:18 +0100 Subject: [PATCH 2/2] remove unit test for caret position --- spec/components/labels/SeekbarLabel.spec.ts | 24 --------------------- 1 file changed, 24 deletions(-) diff --git a/spec/components/labels/SeekbarLabel.spec.ts b/spec/components/labels/SeekbarLabel.spec.ts index 324671b2b..2ff8621fd 100644 --- a/spec/components/labels/SeekbarLabel.spec.ts +++ b/spec/components/labels/SeekbarLabel.spec.ts @@ -109,7 +109,6 @@ describe('SeekBarLabel', () => { } as DOMRect; let containerGetDomElementMock: () => jest.Mocked; - let caretGetDomElementMock: () => jest.Mocked; beforeEach(() => { containerGetDomElementMock = jest @@ -122,30 +121,7 @@ describe('SeekBarLabel', () => { }), }); - caretGetDomElementMock = jest.fn().mockReturnValue(MockHelper.generateDOMMock()); - seekbarLabel["container"].getDomElement = containerGetDomElementMock; - seekbarLabel["caret"].getDomElement = caretGetDomElementMock; - }); - - it("when thumbnail within UI container bounds", () => { - const labelRect = { - x: 400, - y: 700, - width: 200, - height: 120, - top: 700, - right: 600, - bottom: 820, - left: 400, - } as DOMRect; - - containerGetDomElementMock().get(0).parentElement!.getBoundingClientRect = - jest.fn().mockReturnValue(labelRect); - - seekbarLabel.setPositionInBounds(100, uiContainerBoundingRect); - - expect(caretGetDomElementMock().css).toHaveBeenCalledWith('transform', null); }); it("when thumbnail would overflow UI container leftside", () => {