Commit 7ba4db06 authored by alexpott's avatar alexpott

Issue #1829328 by Christian Biggins, larowlan | falcon03: Fixed Adding a new...

Issue #1829328 by Christian Biggins, larowlan | falcon03: Fixed Adding a new content type, 'default parent item' is shown even if no menu is selected.
parent 3e3f16e8
......@@ -32,14 +32,19 @@ Drupal.menuUpdateParentList = function () {
var selected = $select.val();
// Remove all exisiting options from dropdown.
$select.children().remove();
// Add new options to dropdown.
// Add new options to dropdown. Keep a count of options for testing later.
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++;
}
}
// Hide the parent options if there are no options for it.
$select.closest('div').toggle(totalOptions > 0).attr('hidden', totalOptions === 0);
}
});
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment