diff --git a/src/app/core/components/widget/widget.component.scss b/src/app/core/components/widget/widget.component.scss index 7fbc6f26..d5d54a89 100644 --- a/src/app/core/components/widget/widget.component.scss +++ b/src/app/core/components/widget/widget.component.scss @@ -40,7 +40,7 @@ fuse-widget { transform: rotateY(180deg); backface-visibility: hidden; - .fuse-widget-flip-button { + [fuseWidgetToggle] { position: absolute; top: 0; right: 0; diff --git a/src/app/core/components/widget/widget.component.ts b/src/app/core/components/widget/widget.component.ts index 0588c76e..e92e07e6 100644 --- a/src/app/core/components/widget/widget.component.ts +++ b/src/app/core/components/widget/widget.component.ts @@ -11,6 +11,7 @@ import { FuseWidgetToggleDirective } from './widget-toggle.directive'; export class FuseWidgetComponent implements OnInit, AfterContentInit { @HostBinding('class.flipped') flipped = false; + @ContentChildren(FuseWidgetToggleDirective, {descendants: true}) toggleButtons: QueryList; constructor(private el: ElementRef, private renderer: Renderer2) { @@ -25,10 +26,8 @@ export class FuseWidgetComponent implements OnInit, AfterContentInit { setTimeout(() => { - const flipButtons = this.el.nativeElement.querySelectorAll('.fuse-widget-flip-button'); - - flipButtons.forEach(flipButton => { - this.renderer.listen(flipButton, 'click', () => { + this.toggleButtons.forEach(flipButton => { + this.renderer.listen(flipButton.el.nativeElement, 'click', () => { this.toggle(); }); }); diff --git a/src/app/main/content/apps/dashboards/project/project.component.html b/src/app/main/content/apps/dashboards/project/project.component.html index ae277f07..59022f4d 100644 --- a/src/app/main/content/apps/dashboards/project/project.component.html +++ b/src/app/main/content/apps/dashboards/project/project.component.html @@ -57,7 +57,7 @@ - @@ -79,7 +79,7 @@
- @@ -100,7 +100,7 @@
{{widgets.widget2.title}}
-
@@ -121,7 +121,7 @@
- @@ -142,7 +142,7 @@
{{widgets.widget3.title}}
-
@@ -163,7 +163,7 @@
- @@ -184,7 +184,7 @@
{{widgets.widget4.title}}
-
@@ -204,7 +204,7 @@
-