Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

Commit

Permalink
feat(feature-discovery): add classes input to feature directive
Browse files Browse the repository at this point in the history
  • Loading branch information
garygrossgarten committed Nov 28, 2019
1 parent a6bd38c commit 2fe1209
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import {
ElementRef,
Renderer2,
Output,
EventEmitter
EventEmitter,
HostBinding
} from '@angular/core';
import {
AnimationEvent,
Expand Down Expand Up @@ -66,6 +67,7 @@ export class FivFeatureDiscovery implements OnInit, AfterContentInit {
contentOffset = 0;
bounds: FeaturePosition;
icon: string;
classes: string[];
@ViewChild('circle', { static: true }) circle: ElementRef;
@ViewChild('rect', { static: true }) rect: ElementRef;
@ViewChild('pInner', { static: true, read: ElementRef })
Expand All @@ -81,6 +83,10 @@ export class FivFeatureDiscovery implements OnInit, AfterContentInit {
@Output() fivOpen = new EventEmitter<any>();
@Output() fivAnimation = new EventEmitter<AnimationEvent>();

@HostBinding('class') get _classes() {
return this.classes.join(' ');
}

constructor(private renderer: Renderer2, private platform: Platform) {}

ngOnInit() {}
Expand Down
2 changes: 2 additions & 0 deletions projects/core/src/lib/feature-discovery/feature.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export class FivFeature {
@Input() contentOffset = 20;
@Input() featurePadding = 20;
@Input() clickEnabled = true;
@Input() classes: string[] = [];
@Input() fivFeature: TemplateRef<any>;
overlayRef: ComponentRef<FivFeatureDiscovery>;

Expand Down Expand Up @@ -73,6 +74,7 @@ export class FivFeature {
featureOverlay.width = this.diameter;
featureOverlay.featurePadding = this.featurePadding;
featureOverlay.contentOffset = this.contentOffset;
featureOverlay.classes = this.classes;
featureOverlay.setIcon(icon);
featureOverlay.setBounds(bounds);
featureOverlay.show();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<ion-fab vertical="bottom" horizontal="end" slot="fixed">
<ion-fab-button color="primary" (click)="log('FAB Clicked')">
<!-- use the fiv-icon for cool icon effect -->
<fiv-icon #fab="fivFeature" [fivFeature]="fabContent" [featurePadding]="fp" [contentOffset]="co" name="add"
<fiv-icon [classes]="['cool','classes']" #fab="fivFeature" [fivFeature]="fabContent" [featurePadding]="fp" [contentOffset]="co" name="add"
(fivFeatureClick)="log('feature click')" (fivWillOpen)="log('fiv will open')" (fivOpen)="log('fiv open')"
(fivWillClose)="log('fiv will close')" (fivClose)="log('fiv close')">
</fiv-icon>
Expand Down

0 comments on commit 2fe1209

Please sign in to comment.