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

Commit

Permalink
Handle intselection in convertvalues.
Browse files Browse the repository at this point in the history
  • Loading branch information
toirl committed Oct 24, 2017
1 parent 1b3c409 commit b3c11c6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions formbar/static/js/formbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,14 @@ var ruleEngine = function () {
case 'stringselection':
case 'string':
return (!stringContainsArray(v))?"'"+v.replace(/\n/g,'').replace(/'/g,'\\\'')+"'":v;
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);
}
return currentValue.value.map(Number) || "None";
default:
return currentValue.value || "None";
}
Expand Down

0 comments on commit b3c11c6

Please sign in to comment.