X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=web%2Fcore%2Fmodules%2Fmenu_ui%2Fmenu_ui.admin.es6.js;fp=web%2Fcore%2Fmodules%2Fmenu_ui%2Fmenu_ui.admin.es6.js;h=3144d13dc1b33788ae60aefdf1df786fa55fb794;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hp=fabcec048d0cff6e3f4816c92108e3331d10127a;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0;p=yaffs-website
diff --git a/web/core/modules/menu_ui/menu_ui.admin.es6.js b/web/core/modules/menu_ui/menu_ui.admin.es6.js
index fabcec048..3144d13dc 100644
--- a/web/core/modules/menu_ui/menu_ui.admin.es6.js
+++ b/web/core/modules/menu_ui/menu_ui.admin.es6.js
@@ -47,14 +47,12 @@
$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(
- $(``).val(machineName).text(options[machineName]),
- );
- totalOptions++;
- }
- }
+ Object.keys(options || {}).forEach((machineName) => {
+ $select.append(
+ $(``).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);