Skip to content

Commit

Permalink
Volumes: handle error in volume list better.
Browse files Browse the repository at this point in the history
  • Loading branch information
willp24 authored and tomka committed Oct 17, 2018
1 parent 7a22f30 commit bae8dbf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions django/applications/catmaid/static/js/helpers/volumes.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
};
});
if (options.mode === "radio") {
if (newSelectedIds.length > 1){
let selectedVolume = newSelectedIds || options.selectedVolumeIds;
if (selectedVolume.length > 1){
throw new CATMAID.ValueError("Radio select only takes one selected volume");
}
let selectedVolume = newSelectedIds[0] || options.selectedVolumeIds[0];
// Create actual element based on the returned data
let node = CATMAID.DOM.createRadioSelect('Volumes', volumes,
selectedVolume, true);
selectedVolume[0], true);
// Add a selection handler
node.onchange = function (e) {
let volumeId = e.target.value;
Expand Down

0 comments on commit bae8dbf

Please sign in to comment.