Commit 2911f7a8 authored by Nicolas Fella's avatar Nicolas Fella Committed by Albert Astals Cid
Browse files

Very basic implementation for AFPercent_Keystroke

This is used to filter characters that don't make sense in a percent expression

This implementation is very rudimentary
parent 80afe268
Pipeline #231980 passed with stage
in 7 minutes and 14 seconds
......@@ -335,4 +335,16 @@ function AFSpecial_Keystroke( psf )
return;
}
}
}
}
function AFPercent_Keystroke( nDec, sepStyle )
{
if (event.willCommit) {
event.rc = true
} else {
// Allow only numbers plus possible separators
// TODO disallow too many separators
// TODO Make separator locale-dependen/use sepStyle properly
event.rc = !isNaN(event.change) || event.change == "." || event.change == ","
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment