comparison core/modules/quickedit/js/theme.js @ 14:1fec387a4317

Update Drupal core to 8.5.2 via Composer
author Chris Cannam
date Mon, 23 Apr 2018 09:46:53 +0100
parents 4c8ae668cc8c
children
comparison
equal deleted inserted replaced
13:5fb285c0d0e3 14:1fec387a4317
51 return html; 51 return html;
52 }; 52 };
53 53
54 Drupal.theme.quickeditButtons = function (settings) { 54 Drupal.theme.quickeditButtons = function (settings) {
55 var html = ''; 55 var html = '';
56 for (var i = 0; i < settings.buttons.length; i++) { 56
57 var _loop = function _loop(i) {
57 var button = settings.buttons[i]; 58 var button = settings.buttons[i];
58 if (!button.hasOwnProperty('type')) { 59 if (!button.hasOwnProperty('type')) {
59 button.type = 'button'; 60 button.type = 'button';
60 } 61 }
61 62
62 var attributes = []; 63 var attributes = [];
63 var attrMap = settings.buttons[i].attributes || {}; 64 var attrMap = settings.buttons[i].attributes || {};
64 for (var attr in attrMap) { 65 Object.keys(attrMap).forEach(function (attr) {
65 if (attrMap.hasOwnProperty(attr)) { 66 attributes.push(attr + (attrMap[attr] ? '="' + attrMap[attr] + '"' : ''));
66 attributes.push(attr + (attrMap[attr] ? '="' + attrMap[attr] + '"' : '')); 67 });
67 } 68 html += '<button type="' + button.type + '" class="' + button.classes + '" ' + attributes.join(' ') + '>' + button.label + '</button>';
68 } 69 };
69 html += '<button type="' + button.type + '" class="' + button.classes + '"' + (' ' + attributes.join(' ') + '>'); 70
70 html += button.label; 71 for (var i = 0; i < settings.buttons.length; i++) {
71 html += '</button>'; 72 _loop(i);
72 } 73 }
73 return html; 74 return html;
74 }; 75 };
75 76
76 Drupal.theme.quickeditFormContainer = function (settings) { 77 Drupal.theme.quickeditFormContainer = function (settings) {