Skip to content

Commit

Permalink
Merge pull request #156 from CruGlobal/fix-js-buttons
Browse files Browse the repository at this point in the history
GT-2440 - Update function <button> and <a> tags to trigger GTM.click events
  • Loading branch information
dr-bizz authored Nov 19, 2024
2 parents 88d170f + e22c08a commit d9903a8
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
class="button"
[ngStyle]="{ 'background-color': buttonBgColor, color: buttonTextColor }"
(click)="formAction()"
href="javascript:void(0)"
>{{ buttonText }}</a
>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<ng-container *ngIf="ready">
<div class="linkContent indent">
<a (click)="formAction(events)">{{ linkText }}</a>
<a (click)="formAction(events)" href="javascript:void(0)">{{ linkText }}</a>
</div>
</ng-container>
26 changes: 20 additions & 6 deletions src/app/page/component/tract-page/tract-page.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,30 +43,44 @@
<ng-container *ngIf="(dir$ | async) === 'ltr'">
<!-- If not first page -->
<ng-container *ngIf="(isFirstPage$ | async) === false">
<button
<a
(click)="previous()"
href="javascript:void(0)"
class="button button-white far fa-arrow-left"
></button>
><span class="hide"></span
></a>
</ng-container>

<!-- If not last page -->
<ng-container *ngIf="(isLastPage$ | async) === false">
<button (click)="next()" class="button far fa-arrow-right"></button>
<a
(click)="next()"
href="javascript:void(0)"
class="button far fa-arrow-right"
><span class="hide"></span
></a>
</ng-container>
</ng-container>

<ng-container *ngIf="(dir$ | async) === 'rtl'">
<!-- If not first page -->
<ng-container *ngIf="(isLastPage$ | async) === false">
<button (click)="next()" class="button far fa-arrow-left"></button>
<a
(click)="next()"
href="javascript:void(0)"
class="button far fa-arrow-left"
><span class="hide"></span
></a>
</ng-container>

<!-- If not last page -->
<ng-container *ngIf="(isFirstPage$ | async) === false">
<button
<a
(click)="previous()"
href="javascript:void(0)"
class="button button-white far fa-arrow-right"
></button>
><span class="hide"></span
></a>
</ng-container>
</ng-container>
</div>
Expand Down

0 comments on commit d9903a8

Please sign in to comment.