Skip to content

Commit

Permalink
Fixed the JS error that could not find the CSS style; refactored vari…
Browse files Browse the repository at this point in the history
…able to get method
  • Loading branch information
tschug committed Aug 30, 2024
1 parent 341da22 commit f7ab5fa
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions force-app/main/default/lwc/indicatorBundle/indicatorBundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,13 @@ export default class IndicatorBundle extends LightningElement {
}
}

get isStandardUsage(){
return this.pageUsage == 'standard';
}

initCSSVariables() {

if(this.bundle.CardIconBackground || this.bundle.CardIconForeground) {
if(this.showTitle && this.isStandardUsage && (this.bundle.CardIconBackground || this.bundle.CardIconForeground)) {
var css = this.template.querySelector(".cardIcon").style;

css.setProperty('--backgroundColor', this.bundle.CardIconBackground);
Expand Down Expand Up @@ -104,10 +108,6 @@ export default class IndicatorBundle extends LightningElement {
body: this.bundle.CardText
}

if( this.pageUsage == 'standard'){
this.isStandardUsage = true;
}

if(this.bundle.CardIconBackground || this.bundle.CardIconForeground ){
this.card.iconClass = 'cardIcon slds-media__figure slds-var-m-right_x-small ';
} else {
Expand Down

0 comments on commit f7ab5fa

Please sign in to comment.