fix: more lenient int-list validator parsing (CURA-3275)

allow for empty integers
allow the brackets to be omitted
This commit is contained in:
Tim Kuipers 2017-03-06 14:42:11 +01:00
parent 87c8ff0e08
commit 38a9df9d76

View file

@ -100,7 +100,7 @@ SettingItem
maximumLength: (definition.type == "[int]") ? 20 : 10; maximumLength: (definition.type == "[int]") ? 20 : 10;
validator: RegExpValidator { regExp: (definition.type == "[int]") ? /^\[(\s*-?[0-9]+\s*,)*(\s*-?[0-9]+)\s*\]$/ : (definition.type == "int") ? /^-?[0-9]{0,10}$/ : /^-?[0-9]{0,9}[.,]?[0-9]{0,10}$/ } // definition.type property from parent loader used to disallow fractional number entry validator: RegExpValidator { regExp: (definition.type == "[int]") ? /^\[?(\s*-?[0-9]{0,9}\s*,)*(\s*-?[0-9]{0,9})\s*\]?$/ : (definition.type == "int") ? /^-?[0-9]{0,10}$/ : /^-?[0-9]{0,9}[.,]?[0-9]{0,10}$/ } // definition.type property from parent loader used to disallow fractional number entry
Binding Binding
{ {