From 9516a718d67a34c18b19884165708eac3dd1c7ef Mon Sep 17 00:00:00 2001
From: jojohoch <joachim.hoch@iqb.hu-berlin.de>
Date: Thu, 17 Mar 2022 14:13:27 +0100
Subject: [PATCH] [player] Simplify math keypad template

---
 .../keypad-math/keypad-math.component.html    | 34 ++++++++-----------
 1 file changed, 14 insertions(+), 20 deletions(-)

diff --git a/projects/player/src/app/components/keypad-math/keypad-math.component.html b/projects/player/src/app/components/keypad-math/keypad-math.component.html
index 3c26a227a..c6dbd1072 100644
--- a/projects/player/src/app/components/keypad-math/keypad-math.component.html
+++ b/projects/player/src/app/components/keypad-math/keypad-math.component.html
@@ -8,12 +8,8 @@
         (keyClicked)="keyClicked.emit($event)">
     </aspect-keypad-key>
     <span *ngIf="last && lastRowKey"
-          [class.clear-button-container-floating-keypad]="(
-          preset === 'comparisonOperators' || preset === 'squareDashDot'
-          ) && position === 'floating'"
-          [class.clear-button-container-fixed-keypad]="(
-          preset === 'comparisonOperators' || preset === 'squareDashDot'
-          ) && position !== 'floating'">
+          [class.clear-button-container-floating-keypad]="row.length === 3 && position === 'floating'"
+          [class.clear-button-container-fixed-keypad]="row.length === 3 && position !== 'floating'">
       <button type="button"
               mat-mini-fab
               [class]="position === 'floating' ? 'delete-characters-floating-keypad' : 'delete-characters-fixed-keypad'"
@@ -24,7 +20,7 @@
   </ng-container>
 </div>
 
-<div *ngIf="preset === 'numbersAndOperators' || preset === 'numbersAndBasicOperators'"
+<div *ngIf="additionalRows.length"
      class="grid-layout"
      [class.floating-3-column-grid-layout]="position === 'floating' && preset === 'numbersAndOperators'"
      [class.floating-2-column-grid-layout]="position === 'floating' && preset === 'numbersAndBasicOperators'"
@@ -41,18 +37,16 @@
                   [style.grid-row-end]="rowIndex + 2"
                   (keyClicked)="keyClicked.emit($event)">
       </aspect-keypad-key>
-        <ng-container *ngIf="preset === 'numbersAndOperators'">
-          <aspect-keypad-key *ngIf="key === '='"
-                      [key]="key"
-                      [position]="position"
-                      [oval]="true"
-                      [style.grid-column-start]="3"
-                      [style.grid-column-end]="3"
-                      [style.grid-row-start]="1"
-                      [style.grid-row-end]="3"
-                      (keyClicked)="keyClicked.emit($event)">
-          </aspect-keypad-key>
-        </ng-container>
-      </ng-container>
+      <aspect-keypad-key *ngIf="key === '='"
+                  [key]="key"
+                  [position]="position"
+                  [oval]="true"
+                  [style.grid-column-start]="3"
+                  [style.grid-column-end]="3"
+                  [style.grid-row-start]="1"
+                  [style.grid-row-end]="3"
+                  (keyClicked)="keyClicked.emit($event)">
+      </aspect-keypad-key>
     </ng-container>
+  </ng-container>
 </div>
-- 
GitLab