Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / modules / menu_ui / menu_ui.admin.js
index 324b567a07e51f59905a846ed68e93a02354e6ba..03e0e22ae73d5186781143861d7f002ce838b06e 100644 (file)
         $select.children().remove();
 
         var totalOptions = 0;
-        for (var machineName in options) {
-          if (options.hasOwnProperty(machineName)) {
-            $select.append($('<option ' + (machineName === selected ? ' selected="selected"' : '') + '></option>').val(machineName).text(options[machineName]));
-            totalOptions++;
-          }
-        }
+        Object.keys(options || {}).forEach(function (machineName) {
+          $select.append($('<option ' + (machineName === selected ? ' selected="selected"' : '') + '></option>').val(machineName).text(options[machineName]));
+          totalOptions++;
+        });
 
         $select.closest('div').toggle(totalOptions > 0).attr('hidden', totalOptions === 0);
       }