Skip to content

Commit

Permalink
removes tab-block on invalid expiry, fixes #111
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesse Pollak committed Sep 12, 2014
1 parent 642b632 commit 4c967cd
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 22 deletions.
15 changes: 0 additions & 15 deletions lib/js/card.js
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,6 @@ Card = (function() {
];
if (this.$expiryInput.length === 1) {
expiryFilters.push(this.validToggler('cardExpiry'));
this.$expiryInput.on('keydown', this.handle('captureTab'));
}
this.$expiryInput.bindVal(this.$expiryDisplay, {
join: function(text) {
Expand Down Expand Up @@ -794,20 +793,6 @@ Card = (function() {
flipCard: function($el, e) {
return this.$card.toggleClass('flipped');
},
captureTab: function($el, e) {
var keyCode, val;
keyCode = e.keyCode || e.which;
if (keyCode !== 9 || e.shiftKey) {
return;
}
val = $el.payment('cardExpiryVal');
if (!(val.month || val.year)) {
return;
}
if (!$.payment.validateCardExpiry(val.month, val.year)) {
return e.preventDefault();
}
},
captureName: function($el, e) {
var allowedSymbols, banKeyCodes, keyCode;
keyCode = e.which || e.keyCode;
Expand Down
7 changes: 0 additions & 7 deletions src/coffee/card.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ class Card
expiryFilters = [(val) -> val.replace /(\s+)/g, '']
if @$expiryInput.length == 1
expiryFilters.push @validToggler('cardExpiry')
@$expiryInput.on 'keydown', @handle('captureTab')

@$expiryInput
.bindVal @$expiryDisplay,
Expand Down Expand Up @@ -206,12 +205,6 @@ class Card
@cardType = cardType
flipCard: ($el, e) ->
@$card.toggleClass('flipped')
captureTab: ($el, e) ->
keyCode = e.keyCode or e.which
return if keyCode != 9 or e.shiftKey
val = $el.payment('cardExpiryVal')
return unless val.month or val.year
e.preventDefault() if !$.payment.validateCardExpiry(val.month, val.year)
captureName: ($el, e) ->
keyCode = e.which or e.keyCode
banKeyCodes = [48,49,50,51,52,53,54,55,56,57,106,107,109,110,111,186,187,188,189,190,191,192,219,220,221,222]
Expand Down

0 comments on commit 4c967cd

Please sign in to comment.