// Attributes.
const attributes = [];
const attrMap = settings.buttons[i].attributes || {};
- for (const attr in attrMap) {
- if (attrMap.hasOwnProperty(attr)) {
- attributes.push(attr + ((attrMap[attr]) ? `="${attrMap[attr]}"` : ''));
- }
- }
- html += `<button type="${button.type}" class="${button.classes}"` + ` ${attributes.join(' ')}>`;
- html += button.label;
- html += '</button>';
+ Object.keys(attrMap).forEach((attr) => {
+ attributes.push(attr + ((attrMap[attr]) ? `="${attrMap[attr]}"` : ''));
+ });
+ html += `<button type="${button.type}" class="${button.classes}" ${attributes.join(' ')}>${button.label}</button>`;
}
return html;
};