fix: btn add

This commit is contained in:
Xmader 2020-11-12 09:31:11 -05:00
parent f1555d3db0
commit 6e99cee113
No known key found for this signature in database
GPG Key ID: A20B97FB9EB730E4
1 changed files with 1 additions and 4 deletions

View File

@ -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