Skip to content

Commit

Permalink
add flag to control if multiple columns are allowed (#129)
Browse files Browse the repository at this point in the history
  • Loading branch information
m-wettig authored and MarcusBaitz committed Jul 12, 2018
1 parent 6ee2f85 commit 957d021
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions frontend/lib/js/form-components/DropzoneList.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ type PropsType = {
acceptedDropTypes: string[],
onDrop: Function,
onDelete: Function,
disallowMultipleColumns?: boolean
};

const DropzoneList = (props: PropsType) => {
Expand Down Expand Up @@ -46,11 +47,15 @@ const DropzoneList = (props: PropsType) => {
}
</div>
}
<FreeDropzone
className={props.dropzoneClassName}
containsItem={false}
dropzoneText={props.dropzoneText}
/>
{
// allow at least one column
((props.items && props.items.length === 0) || !props.disallowMultipleColumns) &&
<FreeDropzone
className={props.dropzoneClassName}
containsItem={false}
dropzoneText={props.dropzoneText}
/>
}
</div>
);
};
Expand Down

0 comments on commit 957d021

Please sign in to comment.