X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Ffield_ui%2Ffield_ui.js;h=985790d46ab499b07fcf726f1cfd92df4779d634;hb=1c1cb0980bfa6caf0c24cce671b6bb541dc87583;hp=f8bf3e560649111f96f559852c97dfb90ba8f356;hpb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;p=yaffs-website diff --git a/web/core/modules/field_ui/field_ui.js b/web/core/modules/field_ui/field_ui.js index f8bf3e560..985790d46 100644 --- a/web/core/modules/field_ui/field_ui.js +++ b/web/core/modules/field_ui/field_ui.js @@ -120,16 +120,13 @@ 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('
 
'); + $(ajaxElements).after(Drupal.theme.ajaxProgressThrobber()); $('input[name=refresh_rows]').val(rowNames.join(' ')); $('input[data-drupal-selector="edit-refresh"]').trigger('mousedown'); @@ -166,10 +163,12 @@ 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 = {};