Skip to content

Commit

Permalink
feat(adv-filtering): register svg icons #5496
Browse files Browse the repository at this point in the history
  • Loading branch information
DiyanDimitrov committed Sep 11, 2019
1 parent 1649cac commit fe1c564
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -786,6 +786,8 @@ export class IgxAdvancedFilteringDialogComponent implements AfterViewInit, OnDes
this.overlayService = overlayService;
this.overlayComponentId = overlayComponentId;

this.filteringService.registerSVGIcons();

// Set pointer-events to none of the overlay content element which blocks the grid interaction after dragging
this.overlayService.onOpened.pipe(first()).subscribe(() => {
if (this.element.nativeElement.parentElement) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export class IgxFilteringService implements OnDestroy {
private columnToExpressionsMap = new Map<string, ExpressionUI[]>();
private _datePipe: IgxDatePipeComponent;
private columnStartIndex = -1;
private _filterIconsRegistered = false;

public gridId: string;
public isFilterRowVisible = false;
Expand Down Expand Up @@ -211,10 +212,13 @@ export class IgxFilteringService implements OnDestroy {
* Register filtering SVG icons in the icon service.
*/
public registerSVGIcons(): void {
for (const icon of icons) {
if (!this.iconService.isSvgIconCached(icon.name, FILTERING_ICONS_FONT_SET)) {
this.iconService.addSvgIconFromText(icon.name, icon.value, FILTERING_ICONS_FONT_SET);
if (!this._filterIconsRegistered) {
for (const icon of icons) {
if (!this.iconService.isSvgIconCached(icon.name, FILTERING_ICONS_FONT_SET)) {
this.iconService.addSvgIconFromText(icon.name, icon.value, FILTERING_ICONS_FONT_SET);
}
}
this._filterIconsRegistered = true;
}
}

Expand Down

0 comments on commit fe1c564

Please sign in to comment.