creditable
Advanced tools
Comparing version 1.0.4 to 1.0.5
@@ -18,12 +18,17 @@ // Input a credit card number string, returns a key signifying the type of credit card it is | ||
this.$creditCard.on( "change", function() { | ||
var maxlen = self.getMaxlength(); | ||
if( maxlen ) { | ||
self.$el.attr( "maxlength", maxlen ); | ||
} else { | ||
self.$el.removeAttr( "maxlength" ); | ||
} | ||
self.$el.attr( "placeholder", self.getPlaceholder( maxlen || 4 ) ); | ||
self.updateSecurityCode(); | ||
}); | ||
this.updateSecurityCode(); | ||
} | ||
CreditableSecurityCode.prototype.updateSecurityCode = function() { | ||
var maxlen = this.getMaxlength(); | ||
if( maxlen ) { | ||
this.$el.attr( "maxlength", maxlen ); | ||
} else { | ||
this.$el.removeAttr( "maxlength" ); | ||
} | ||
this.$el.attr( "placeholder", this.getPlaceholder( maxlen || 4 ) ); | ||
}; | ||
CreditableSecurityCode.prototype.getMaxlength = function() { | ||
@@ -30,0 +35,0 @@ return lengths[ CreditableCardType( this.$creditCard.val() ) ]; |
{ | ||
"name": "creditable", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "Utilities for working with credit card form input.", | ||
@@ -5,0 +5,0 @@ "main": "creditablecardtype.js", |
Sorry, the diff of this file is not supported yet
5432
66