if (containerIsVisible !== containerShouldBeVisible) {
const tabMenuListItem = this._container.parentNode!.parentNode!.querySelector(
"#" +
- DomUtil.identify(this._container.parentNode! as HTMLElement) +
+ DomUtil.identify(this._container.parentNode as HTMLElement) +
" > nav > ul > li[data-name=" +
this._container.id +
"]",
- )! as HTMLElement;
+ ) as HTMLElement;
if (tabMenuListItem === null) {
throw new Error("Cannot find tab menu entry for tab '" + this._container.id + "'.");
}
const container = this.containers.get(this.activeMessageId)!;
const objectId = ~~container.dataset.objectId!;
const content = this.messageBodySelector
- ? (container.querySelector(this.messageBodySelector)! as HTMLElement)
+ ? (container.querySelector(this.messageBodySelector) as HTMLElement)
: container;
let anchorNode = selection.anchorNode;
public getOptions(): string[] {
const options: string[] = [];
Array.from(this.optionList.children).forEach((listItem: HTMLLIElement) => {
- const optionValue = (listItem.querySelector("input[type=text]")! as HTMLInputElement).value.trim();
+ const optionValue = (listItem.querySelector("input[type=text]") as HTMLInputElement).value.trim();
if (optionValue !== "") {
options.push(`${listItem.dataset.optionId!}_${optionValue}`);
protected _markReactionAsActive(): void {
let reactionTypeID: number | null = null;
- this._objects.get(this._popoverCurrentObjectId)!.forEach((element) => {
+ for (const element of this._objects.get(this._popoverCurrentObjectId)!) {
if (element.reactButton !== null) {
reactionTypeID = ~~element.reactButton.dataset.reactionTypeId!;
}
- });
+ }
if (reactionTypeID === null) {
throw new Error("Unable to find react button for current popover.");
const scrollableContainer = popover.querySelector(".reactionPopoverContent") as HTMLElement;
if (reactionTypeID) {
const reactionTypeButton = popover.querySelector(
- `.reactionTypeButton[data-reaction-type-id="${reactionTypeID!}"]`,
+ `.reactionTypeButton[data-reaction-type-id="${reactionTypeID}"]`,
) as HTMLElement;
reactionTypeButton.classList.add("active");
reactionTypeButton.setAttribute("aria-selected", "true");
}
_markReactionAsActive() {
let reactionTypeID = null;
- this._objects.get(this._popoverCurrentObjectId).forEach((element) => {
+ for (const element of this._objects.get(this._popoverCurrentObjectId)) {
if (element.reactButton !== null) {
reactionTypeID = ~~element.reactButton.dataset.reactionTypeId;
}
- });
+ }
if (reactionTypeID === null) {
throw new Error("Unable to find react button for current popover.");
}