Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / modules / quickedit / js / util.es6.js
index 7fa952be5c0d15be42e87864faf532ee934a7590..192cea6537b21cf2372c9676c7392bb07be88a3b 100644 (file)
@@ -58,7 +58,7 @@
    */
   Drupal.quickedit.util.networkErrorModal = function (title, message) {
     const $message = $(`<div>${message}</div>`);
-    var networkErrorModal = Drupal.dialog($message.get(0), {
+    const networkErrorModal = Drupal.dialog($message.get(0), {
       title,
       dialogClass: 'quickedit-network-error',
       buttons: [
          *   The HTTP status code.
          */
         success(response, status) {
-          for (const i in response) {
-            if (response.hasOwnProperty(i) && response[i].command && this.commands[response[i].command]) {
+          Object.keys(response || {}).forEach((i) => {
+            if (response[i].command && this.commands[response[i].command]) {
               this.commands[response[i].command](this, response[i], status);
             }
-          }
+          });
         },
         base: $submit.attr('id'),
         element: $submit[0],