Further Drupal 8.6.4 changes. Some core files were not committed before a commit...
[yaffs-website] / web / core / modules / field_ui / field_ui.js
index f8bf3e560649111f96f559852c97dfb90ba8f356..985790d46ab499b07fcf726f1cfd92df4779d634 100644 (file)
     AJAXRefreshRows: function AJAXRefreshRows(rows) {
       var rowNames = [];
       var ajaxElements = [];
-      var rowName = void 0;
-      for (rowName in rows) {
-        if (rows.hasOwnProperty(rowName)) {
-          rowNames.push(rowName);
-          ajaxElements.push(rows[rowName]);
-        }
-      }
+      Object.keys(rows || {}).forEach(function (rowName) {
+        rowNames.push(rowName);
+        ajaxElements.push(rows[rowName]);
+      });
 
       if (rowNames.length) {
-        $(ajaxElements).after('<div class="ajax-progress ajax-progress-throbber"><div class="throbber">&nbsp;</div></div>');
+        $(ajaxElements).after(Drupal.theme.ajaxProgressThrobber());
 
         $('input[name=refresh_rows]').val(rowNames.join(' '));
         $('input[data-drupal-selector="edit-refresh"]').trigger('mousedown');
 
       this.$regionSelect.val(region);
 
-      var value = typeof this.defaultPlugin !== 'undefined' ? this.defaultPlugin : this.$pluginSelect.find('option').val();
+      if (this.region === 'hidden') {
+        var value = typeof this.defaultPlugin !== 'undefined' ? this.defaultPlugin : this.$pluginSelect.find('option').val();
 
-      if (typeof value !== 'undefined') {
-        this.$pluginSelect.val(value);
+        if (typeof value !== 'undefined') {
+          this.$pluginSelect.val(value);
+        }
       }
 
       var refreshRows = {};