diff --git a/frontend/src/app/components/fab/speed-dial/speed-dial-option.directive.ts b/frontend/src/app/components/fab/speed-dial/speed-dial-option.directive.ts
index 1ed1b9f..071ad41 100644
--- a/frontend/src/app/components/fab/speed-dial/speed-dial-option.directive.ts
+++ b/frontend/src/app/components/fab/speed-dial/speed-dial-option.directive.ts
@@ -7,10 +7,10 @@ import { MatTooltip } from '@angular/material/tooltip';
})
export class SpeedDialOptionDirective {
constructor(
- @Host() @Optional() test?: MatTooltip,
- @Host() @Optional() test2?: MatButton
+ @Host() @Optional() tooltip?: MatTooltip,
+ @Host() @Optional() button?: MatButton
) {
- if (test) test.position = 'left';
- if (test2) test2.color = 'primary';
+ if (tooltip) tooltip.position = 'left';
+ if (button) button.color = 'primary';
}
}
diff --git a/frontend/src/app/components/fab/speed-dial/speed-dial.component.ts b/frontend/src/app/components/fab/speed-dial/speed-dial.component.ts
index b5707cd..0d55308 100644
--- a/frontend/src/app/components/fab/speed-dial/speed-dial.component.ts
+++ b/frontend/src/app/components/fab/speed-dial/speed-dial.component.ts
@@ -21,37 +21,48 @@ export class SpeedDialComponent {
public openManager = new OpenManager();
- private lastMouseEvent: number = 0;
+ private touchUntil: number = 0;
+
+ @HostListener('document:touchstart', ['$event'])
+ @HostListener('document:touchend', ['$event'])
+ touchEvent(e: TouchEvent) {
+ if (e.type === 'touchstart') {
+ this.touchUntil = Infinity;
+ } else {
+ this.touchUntil = e.timeStamp + 2000;
+ }
+ }
@HostListener('document:click', ['$event'])
- anyClick(e: MouseEvent) {
- if (!this.openManager.isOpen) return;
- if (this.lastMouseEvent === e.timeStamp) return;
+ @HostListener('document:keydown.escape', ['$event'])
+ anyClick(e: Event) {
+ console.log(e);
+ if (!this.openManager.isOpen || this.openManager.isAnimating) return;
this.openManager.close();
}
click(e: MouseEvent) {
- if (this.lastMouseEvent === e.timeStamp) return;
-
- this.lastMouseEvent = e.timeStamp;
- const value = this.openManager.toggle();
-
- if (value === false) {
+ console.log(e);
+ if (!this.openManager.isOpen) {
+ this.openManager.open();
+ } else {
this.clickEmitter.next();
}
}
enter(e: MouseEvent) {
+ if (e.timeStamp <= this.touchUntil) return;
+
if (this.openOnHover) {
- this.lastMouseEvent = e.timeStamp;
this.openManager.open();
}
}
leave(e: MouseEvent) {
+ if (e.timeStamp <= this.touchUntil) return;
+
if (this.openOnHover) {
- this.lastMouseEvent = e.timeStamp;
this.openManager.close();
}
}
diff --git a/frontend/src/app/routes/view/view.component.html b/frontend/src/app/routes/view/view.component.html
index 01c5cf9..e6c12bd 100644
--- a/frontend/src/app/routes/view/view.component.html
+++ b/frontend/src/app/routes/view/view.component.html
@@ -47,13 +47,7 @@
[open-on-hover]="true"
(main-click)="download()"
>
-
-
-