Skip to content

Commit

Permalink
fix(feature): focused feature not properly focused in toolbox
Browse files Browse the repository at this point in the history
  • Loading branch information
cbourget authored and mbarbeau committed May 15, 2017
1 parent 71c06a6 commit c2d88fe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export class FeatureDetailsBindingDirective implements OnInit, OnDestroy {

ngOnInit() {
this.focusedFeatures$$ = this.featureService.focusedFeature$
.filter(feature => feature !== undefined)
.subscribe(feature => this.component.feature = feature);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ export class FeatureListBindingDirective implements OnInit, OnDestroy {
private initialized: boolean = false;

@HostListener('focus', ['$event']) onFocus(feature: Feature) {
if (this.initialized) {
if (this.initialized || this.featureService.focusedFeature$.value === undefined) {
this.featureService.focusFeature(feature);
}
}

@HostListener('select', ['$event']) onSelect(feature: Feature) {
if (this.initialized) {
if (this.initialized || this.featureService.selectedFeature$.value === undefined) {
this.featureService.selectFeature(feature);
}
}
Expand All @@ -46,6 +46,7 @@ export class FeatureListBindingDirective implements OnInit, OnDestroy {
// having multiple feature list is unusual, no better fix is provided
// for now.
this.focusedFeature$$ = this.featureService.focusedFeature$
.filter(feature => feature !== undefined)
.debounceTime(100)
.subscribe(feature => this.component.focusedFeature = feature);

Expand Down

0 comments on commit c2d88fe

Please sign in to comment.