jQuery-Plugins
jQuery-Plugins copied to clipboard
Preventing negative numbers
On my project, we very often need to restrain users to positive numbers, so I changed numeric() to take an object literal. Another change I might make in the future is another option to universally allow a keystroke if a modifier key (i.e. alt/ctrl/cmd) is held down.
I realize that this signature change would break backwards compatibility, but I think the object literal with an explicit config would make the options more apparent to users (I got stuck trying to declare no decimal by specifying '' at first).
i did the same thing, would be good to see it in master
Hi Sam, I just added this commit to try to ensure BC (check if the first param is a boolean and wrap it in the appropriate property of the new config object: https://github.com/searls/jQuery-Plugins/commit/a637a3a9f7d781813d58c0588140089a619570cd
Is this still planned for a major revision?