()
| 357 | } |
| 358 | |
| 359 | private _updateFontIconClasses() { |
| 360 | if (!this._usingFontIcon()) { |
| 361 | return; |
| 362 | } |
| 363 | |
| 364 | const elem: HTMLElement = this._elementRef.nativeElement; |
| 365 | const fontSetClasses = ( |
| 366 | this.fontSet |
| 367 | ? this._iconRegistry.classNameForFontAlias(this.fontSet).split(/ +/) |
| 368 | : this._iconRegistry.getDefaultFontSetClass() |
| 369 | ).filter(className => className.length > 0); |
| 370 | |
| 371 | this._previousFontSetClass.forEach(className => elem.classList.remove(className)); |
| 372 | fontSetClasses.forEach(className => elem.classList.add(className)); |
| 373 | this._previousFontSetClass = fontSetClasses; |
| 374 | |
| 375 | if ( |
| 376 | this.fontIcon !== this._previousFontIconClass && |
| 377 | !fontSetClasses.includes('mat-ligature-font') |
| 378 | ) { |
| 379 | if (this._previousFontIconClass) { |
| 380 | elem.classList.remove(this._previousFontIconClass); |
| 381 | } |
| 382 | if (this.fontIcon) { |
| 383 | elem.classList.add(this.fontIcon); |
| 384 | } |
| 385 | this._previousFontIconClass = this.fontIcon; |
| 386 | } |
| 387 | } |
| 388 | |
| 389 | /** |
| 390 | * Cleans up a value to be used as a fontIcon or fontSet. |
no test coverage detected