From dacd44fb614dd0a53f3ce3baa77043b6e1531dbd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Julian=20Sp=C3=A4th?= <julian.spaeth@wzw.tum.de>
Date: Sat, 11 Apr 2020 12:03:21 +0200
Subject: [PATCH] Enhance find drugs menu

---
 src/app/components/toggle/toggle.component.html | 5 ++++-
 src/app/components/toggle/toggle.component.ts   | 3 ++-
 src/styles.scss                                 | 4 ++++
 3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/app/components/toggle/toggle.component.html b/src/app/components/toggle/toggle.component.html
index 08a9cb81..ae728a9a 100644
--- a/src/app/components/toggle/toggle.component.html
+++ b/src/app/components/toggle/toggle.component.html
@@ -2,7 +2,7 @@
   <p class="control has-tooltip">
     <button class="button is-rounded has-tooltip" [attr.data-tooltip]="tooltipOn" [class.is-primary]="value" (click)="toggle(true)">
       <span class="icon is-small">
-        <i class="fa {{icon}}"></i>
+        <i class="fa {{iconOn}}"></i>
       </span>
       <span>{{textOn}}</span>
     </button>
@@ -10,6 +10,9 @@
   <p class="control">
     <button class="button is-rounded has-tooltip" [attr.data-tooltip]="tooltipOff" [class.is-primary]="!value" (click)="toggle(false)">
       <span>{{textOff}}</span>
+      <span *ngIf="iconOff" class="icon is-small">
+        <i class="fa {{iconOff}}"></i>
+      </span>
     </button>
   </p>
 </div>
diff --git a/src/app/components/toggle/toggle.component.ts b/src/app/components/toggle/toggle.component.ts
index 5c3444e9..555e10dd 100644
--- a/src/app/components/toggle/toggle.component.ts
+++ b/src/app/components/toggle/toggle.component.ts
@@ -7,7 +7,8 @@ import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
 })
 export class ToggleComponent implements OnInit {
 
-  @Input() icon = 'fa-check';
+  @Input() iconOn = 'fa-check';
+  @Input() iconOff = 'fa-times';
 
   @Input() textOn = 'On';
   @Input() textOff = 'Off';
diff --git a/src/styles.scss b/src/styles.scss
index e539e5fc..d59245a8 100644
--- a/src/styles.scss
+++ b/src/styles.scss
@@ -177,6 +177,10 @@ div.field.has-addons.add-remove-toggle {
   color: $danger;
 }
 
+.fa-times {
+  color: $danger;
+}
+
 .footer-buttons {
   margin-left: 20px;
   margin-right: 10px;
-- 
GitLab