From 6e99cee113d9ee47c197577b8a66ce9127be6215 Mon Sep 17 00:00:00 2001 From: Xmader Date: Thu, 12 Nov 2020 09:31:11 -0500 Subject: [PATCH] fix: btn add --- src/btn.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/btn.ts b/src/btn.ts index e41842d..51de32d 100644 --- a/src/btn.ts +++ b/src/btn.ts @@ -48,10 +48,7 @@ export class BtnList { add (options: BtnOptions): BtnElement { const btn = this.getTemplateBtn().cloneNode(true) as HTMLButtonElement - const textNode = [...btn.childNodes].find((x) => { - const txt = (x.textContent as string).replace(/\s/g, '') - return txt.includes('Download') || txt.includes('Print') - }) as HTMLSpanElement + const textNode = [...btn.children].find(x => x.nodeName === 'SPAN') as HTMLSpanElement const setText = (str: string): void => { textNode.textContent = str