[chore] TSLint cleanup

This commit is contained in:
Steven Evans
2018-07-08 01:11:34 -04:00
parent 28bebeb144
commit 41fbf63f0d
7 changed files with 94 additions and 43 deletions
+6 -2
View File
@@ -1,5 +1,8 @@
import { createElement } from "./createElement";
/**
* Possible configuration parameters when creating the accordion element.
*/
interface IAccordionConfigurationParameters {
/**
* The HTML to appear in the accordion header.
@@ -16,6 +19,7 @@ interface IAccordionConfigurationParameters {
*/
panelText?: string;
}
/**
* Creates both the header and panel element of an accordion and sets the click handler
* @param params The creation parameters.
@@ -28,11 +32,11 @@ export function createAccordionElement(params: IAccordionConfigurationParameters
const pnl: CSSStyleDeclaration = (this.nextElementSibling as HTMLDivElement).style;
pnl.display = pnl.display === "block" ? "none" : "block";
},
id: params.id ? `${params.id}-hdr` : undefined,
id: params.id !== undefined ? `${params.id}-hdr` : undefined,
innerHTML: params.hdrText,
}) as HTMLButtonElement;
const panel: HTMLDivElement = createElement("div", {
id: params.id ? `${params.id}-panel` : undefined,
id: params.id !== undefined ? `${params.id}-panel` : undefined,
innerHTML: params.panelText,
}) as HTMLDivElement;