Skip to content

Commit

Permalink
fixed curly brace warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ens13533 committed Feb 19, 2024
1 parent 547c197 commit b3324f1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
15 changes: 10 additions & 5 deletions coral-base-component/src/scripts/BaseComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -519,12 +519,14 @@ const BaseComponent = (superClass) => class extends superClass {
this._reflectedAttribute = true;
this.setAttribute(attributeName, '');
this._reflectedAttribute = false;
} else if (!value && this.hasAttribute(attributeName)) {
}
else if (!value && this.hasAttribute(attributeName)) {
this._reflectedAttribute = true;
this.removeAttribute(attributeName);
this._reflectedAttribute = false;
}
} else if (this.getAttribute(attributeName) !== String(value)) {
}
else if (this.getAttribute(attributeName) !== String(value)) {
this._reflectedAttribute = true;
this.setAttribute(attributeName, value);
this._reflectedAttribute = false;
Expand Down Expand Up @@ -695,7 +697,8 @@ const BaseComponent = (superClass) => class extends superClass {
const setProperty = (prop, val) => {
if (isContentZone(prop)) {
updateContentZone(prop, val);
} else {
}
else {
this._silenced = silent;
/** @ignore */
this[prop] = val;
Expand All @@ -709,7 +712,8 @@ const BaseComponent = (superClass) => class extends superClass {
value = valueOrSilent;

setProperty(property, value);
} else {
}
else {
properties = propertyOrProperties;
silent = valueOrSilent;

Expand Down Expand Up @@ -775,7 +779,8 @@ const BaseComponent = (superClass) => class extends superClass {
let handler = event.detail.handler;
if(typeof handler === 'function') {
handler(this);
} else {
}
else {
throw new Error("Messenger handler should be a function");
}
}
Expand Down
6 changes: 4 additions & 2 deletions coral-base-formfield/src/scripts/BaseFormField.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,8 @@ const BaseFormField = (superClass) => class extends superClass {
if (element.matches(LABELLABLE_ELEMENTS_SELECTOR)) {
this._updateForAttributes(value, elementId);
}
} else {
}
else {
// since no labelledby value was set, we remove everything
element.removeAttribute('aria-labelledby');
}
Expand Down Expand Up @@ -361,7 +362,8 @@ const BaseFormField = (superClass) => class extends superClass {
if (forAttribute === elementId) {
labelElement.removeAttribute('for');
}
} else {
}
else {
// if we do not have to remove, it does not matter the current value of the label, we can set it in every
// case
labelElement.setAttribute('for', elementId);
Expand Down
3 changes: 2 additions & 1 deletion coral-base-labellable/src/scripts/BaseLabellable.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ const BaseLabellable = (superClass) => class extends superClass {
attributeChangedCallback(name, oldValue, value) {
if (name === 'aria-label' || name === 'aria-labelledby') {
this._toggleIconAriaHidden();
} else {
}
else {
super.attributeChangedCallback(name, oldValue, value);
}
}
Expand Down

0 comments on commit b3324f1

Please sign in to comment.