Skip to content

Commit

Permalink
[#55581] remove unneede clean up of angular double quotes
Browse files Browse the repository at this point in the history
This was a leftover that can now be removed.
  • Loading branch information
EinLama committed Dec 2, 2024
1 parent 4c17609 commit 818876a
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,6 @@ export class HoverCardTriggerService {
const turboFrameUrl = el.getAttribute('data-hover-card-url');
if (!turboFrameUrl) { return; }

// When set in an angular component, the url attribute might be wrapped in additional quotes. Strip them.
const cleanedTurboFrameUrl = turboFrameUrl.replace(/^"(.*)"$/, '$1');

// Reset close timer for when hovering over multiple triggers in quick succession.
// A timer from a previous hover card might still be running. We do not want it to
// close the new (i.e. this) hover card.
Expand All @@ -90,7 +87,7 @@ export class HoverCardTriggerService {

// Set a delay before showing the hover card
this.hoverTimeout = window.setTimeout(() => {
this.showHoverCard(el, cleanedTurboFrameUrl, e);
this.showHoverCard(el, turboFrameUrl, e);
}, this.OPEN_DELAY_IN_MS);
});

Expand All @@ -111,7 +108,7 @@ export class HoverCardTriggerService {
});
}

private showHoverCard(el:HTMLElement, cleanedTurboFrameUrl:string, e:JQuery.MouseOverEvent) {
private showHoverCard(el:HTMLElement, turboFrameUrl:string, e:JQuery.MouseOverEvent) {
// Abort if the element is no longer present in the DOM. This can happen when this method is called after a delay.
if (!document.body.contains(el)) { return; }

Expand All @@ -122,7 +119,7 @@ export class HoverCardTriggerService {
const modal = this.opModalService.showIfNotActive(
HoverCardComponent,
this.injector,
{ turboFrameSrc: cleanedTurboFrameUrl, event: e },
{ turboFrameSrc: turboFrameUrl, event: e },
true,
false,
this.modalTarget,
Expand Down

0 comments on commit 818876a

Please sign in to comment.