Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / modules / quickedit / js / util.js
index 16b524a9f3104c2d414edd99b7546a4ed344b756..a9c09728619ec0ca0fbf1bf368634eb0801288e2 100644 (file)
         },
 
         success: function success(response, status) {
-          for (var i in response) {
-            if (response.hasOwnProperty(i) && response[i].command && this.commands[response[i].command]) {
-              this.commands[response[i].command](this, response[i], status);
+          var _this = this;
+
+          Object.keys(response || {}).forEach(function (i) {
+            if (response[i].command && _this.commands[response[i].command]) {
+              _this.commands[response[i].command](_this, response[i], status);
             }
-          }
+          });
         },
 
         base: $submit.attr('id'),