Permalink
Browse files

Merge pull request #20 from bryanrsmith/master

Fix faulty validation check on numeric.
Fix bug where setOptions method ignored falsey properties on provided options.
  • Loading branch information...
2 parents fd0f3b1 + 74dde83 commit 1755326a0e6ea5f3e8c5bc4129123a218b4e5c15 @tommoor committed Mar 12, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 tinycon.js
View
@@ -206,8 +206,8 @@
Tinycon.setOptions = function(custom){
options = {};
- for(var i in defaults){
- options[i] = custom[i] ? custom[i] : defaults[i];
+ for(var key in defaults){
+ options[key] = custom.hasOwnProperty(key) ? custom[key] : defaults[key];
}
return this;
};
@@ -221,7 +221,7 @@
Tinycon.setBubble = function(num, colour){
// validate
- if(isNaN(num)) return log('Bubble must be a number');
+ if(isNaN(parseFloat(num)) || !isFinite(num)) return log('Bubble must be a number');
drawFavicon(num, colour);
return this;

0 comments on commit 1755326

Please sign in to comment.