comparison core/modules/quickedit/js/util.es6.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 129ea1e6d783
comparison
equal deleted inserted replaced
13:5fb285c0d0e3 14:1fec387a4317
56 * @param {string} message 56 * @param {string} message
57 * The message to use in the modal dialog. 57 * The message to use in the modal dialog.
58 */ 58 */
59 Drupal.quickedit.util.networkErrorModal = function (title, message) { 59 Drupal.quickedit.util.networkErrorModal = function (title, message) {
60 const $message = $(`<div>${message}</div>`); 60 const $message = $(`<div>${message}</div>`);
61 var networkErrorModal = Drupal.dialog($message.get(0), { 61 const networkErrorModal = Drupal.dialog($message.get(0), {
62 title, 62 title,
63 dialogClass: 'quickedit-network-error', 63 dialogClass: 'quickedit-network-error',
64 buttons: [ 64 buttons: [
65 { 65 {
66 text: Drupal.t('OK'), 66 text: Drupal.t('OK'),
179 * The Drupal AJAX response. 179 * The Drupal AJAX response.
180 * @param {number} [status] 180 * @param {number} [status]
181 * The HTTP status code. 181 * The HTTP status code.
182 */ 182 */
183 success(response, status) { 183 success(response, status) {
184 for (const i in response) { 184 Object.keys(response || {}).forEach((i) => {
185 if (response.hasOwnProperty(i) && response[i].command && this.commands[response[i].command]) { 185 if (response[i].command && this.commands[response[i].command]) {
186 this.commands[response[i].command](this, response[i], status); 186 this.commands[response[i].command](this, response[i], status);
187 } 187 }
188 } 188 });
189 }, 189 },
190 base: $submit.attr('id'), 190 base: $submit.attr('id'),
191 element: $submit[0], 191 element: $submit[0],
192 }; 192 };
193 193