Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / modules / quickedit / js / theme.es6.js
index 5b43f427bdf037f5cbd06bc5c9c371b8248c18da..b9355b13aa8ab4928ea2404e8ee99f676fa35142 100644 (file)
       // 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;
   };