def selected_list(element):
    """ Given an element dict, return a list of the indexes. """
    if 'selected' in element:
        return element['selected']
    return [int(idx.strip()) for idx in element['value'].split(',')]