Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / modules / menu_ui / menu_ui.admin.es6.js
index fabcec048d0cff6e3f4816c92108e3331d10127a..3144d13dc1b33788ae60aefdf1df786fa55fb794 100644 (file)
         $select.children().remove();
         // Add new options to dropdown. Keep a count of options for testing later.
         let totalOptions = 0;
-        for (const 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((machineName) => {
+          $select.append(
+            $(`<option ${machineName === selected ? ' selected="selected"' : ''}></option>`).val(machineName).text(options[machineName]),
+          );
+          totalOptions++;
+        });
 
         // Hide the parent options if there are no options for it.
         $select.closest('div').toggle(totalOptions > 0).attr('hidden', totalOptions === 0);