Skip to content
This repository has been archived by the owner on May 29, 2024. It is now read-only.

Commit

Permalink
Further fixes on intselection.
Browse files Browse the repository at this point in the history
  • Loading branch information
toirl committed Oct 24, 2017
1 parent b3c11c6 commit f0bd538
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions formbar/static/js/formbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,15 @@ var ruleEngine = function () {
case 'intselection':
// "" in Checkboxes is a hack to simulate an empty
// selection. For rule evaluation we can/must remove it.
var i = currentValue.value.indexOf("");
if(i != -1) {
currentValue.value.splice(i, 1);
if (Array.isArray(currentValue.value)) {
var i = currentValue.value.indexOf("");
if(i != -1) {
currentValue.value.splice(i, 1);
}
return currentValue.value.map(Number) || "None";
} else {
return Number(currentValue.value);
}
return currentValue.value.map(Number) || "None";
default:
return currentValue.value || "None";
}
Expand Down

0 comments on commit f0bd538

Please sign in to comment.