summary: Correct casting for scalars

* src/current/scripts/entry-form.js: Ensure scalars are cast to numbers
    before outputting dfn.
master v2.5.1
Mike Gerwitz 2017-12-11 16:09:10 -05:00
parent 4ebe81bcb6
commit 0f0e88d9fb
1 changed files with 3 additions and 4 deletions

View File

@ -215,7 +215,7 @@ var client = ( function()
var target = e.target,
name = target.name.replace( /\[\]$/, '' ),
value = target.value.trim();
value = +target.value.trim();
if ( !name )
{
@ -261,7 +261,7 @@ var client = ( function()
bucket[ name ] = value;
// update entry dfn
updateParamTestcaseDfn( target.name, value );
updateParamTestcaseDfn( name, value );
} );
// update screen on submit
@ -318,9 +318,8 @@ var client = ( function()
} );
function updateParamTestcaseDfn( field_name, value )
function updateParamTestcaseDfn( name, value )
{
const name = field_name.replace( /\[\]$/, '' );
const dfn_element = getParamTestcaseDfnElement( name );
value = value || bucket[ name ];