Skip to content

Instantly share code, notes, and snippets.

@ericf
Created March 23, 2011 04:21
Show Gist options
  • Select an option

  • Save ericf/882612 to your computer and use it in GitHub Desktop.

Select an option

Save ericf/882612 to your computer and use it in GitHub Desktop.
_setNewAmount : function (v) {
var amountMin = TipUI.AMOUNT_MIN,
amountMax = TipUI.AMOUNT_MAX;
if (isString(v)) {
v = parseAmount(v);
}
if (isNull(v)) { return v; }
if (isNumber(v)) {
return (v >= amountMin && v <= amountMax ? v : null);
}
return Y.Attribute.INVALID_VALUE;
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment