Skip to content

Commit

Permalink
Merge branch 'hotfix/94-fix-event-emission'
Browse files Browse the repository at this point in the history
  • Loading branch information
kenkeiter committed Sep 8, 2013
2 parents be62ef7 + 95c87e4 commit 2d3067e
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .semver
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
:major: 1
:minor: 0
:patch: 2
:patch: 3
:special: ''
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Skeuocard (v1.0.2)
# Skeuocard (v1.0.3)

_Skeuocard_ is a re-think of the way we handle credit card input on the web. It progressively enhances credit card input forms so that the card inputs become skeuomorphic, facilitating accurate and fast card entry, and removing barriers to purchase.

Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"skeuomorphism"
],
"description": "Skeuocard progressively enhances credit card inputs to provide a skeuomorphic interface.",
"version": "1.0.2",
"version": "1.0.3",
"license": "The MIT License (MIT)",
"readmeFilename": "README.md",
"repository": {
Expand Down
15 changes: 8 additions & 7 deletions javascripts/skeuocard.js
Original file line number Diff line number Diff line change
Expand Up @@ -335,11 +335,11 @@
this.trigger("fieldFillStateDidChange.skeuocard", [this, fieldName, isFilled]);
}
if (validationStateChanged) {
this.trigger("fieldValidationStateWillChange.skeuocard", [this, fieldName, isFilled]);
this.trigger("fieldValidationStateWillChange.skeuocard", [this, fieldName, isValid]);
this._inputViews[fieldName].el.toggleClass('valid', isValid);
this._inputViews[fieldName].el.toggleClass('invalid', !isValid);
this._state["" + fieldName + "Valid"] = isValid;
this.trigger("fieldValidationStateDidChange.skeuocard", [this, fieldName, isFilled]);
this.trigger("fieldValidationStateDidChange.skeuocard", [this, fieldName, isValid]);
}
return this._updateValidationForFace(this.visibleFace);
};
Expand Down Expand Up @@ -418,7 +418,7 @@
front: [],
back: []
};
focused = $('*:focus');
focused = $('input:focus');
_ref = product.attrs.layout;
for (fieldName in _ref) {
destFace = _ref[fieldName];
Expand All @@ -430,10 +430,11 @@
}
setTimeout(function() {
var fieldEl, fieldLength;
fieldEl = focused.first();
fieldLength = fieldEl[0].maxLength;
fieldEl.focus();
return fieldEl[0].setSelectionRange(fieldLength, fieldLength);
if ((fieldEl = focused.first()) != null) {
fieldLength = fieldEl[0].maxLength;
fieldEl.focus();
return fieldEl[0].setSelectionRange(fieldLength, fieldLength);
}
}, 10);
} else {
_ref1 = this._inputViews;
Expand Down
2 changes: 1 addition & 1 deletion javascripts/skeuocard.min.js

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions javascripts/src/Skeuocard.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -293,11 +293,11 @@ class Skeuocard

# If the valid state has changed, trigger events, and make styling changes.
if validationStateChanged
@trigger "fieldValidationStateWillChange.skeuocard", [@, fieldName, isFilled]
@trigger "fieldValidationStateWillChange.skeuocard", [@, fieldName, isValid]
@_inputViews[fieldName].el.toggleClass 'valid', isValid
@_inputViews[fieldName].el.toggleClass 'invalid', not isValid
@_state["#{fieldName}Valid"] = isValid
@trigger "fieldValidationStateDidChange.skeuocard", [@, fieldName, isFilled]
@trigger "fieldValidationStateDidChange.skeuocard", [@, fieldName, isValid]

@_updateValidationForFace(@visibleFace)

Expand Down Expand Up @@ -355,7 +355,7 @@ class Skeuocard

# set visibility and re-layout fields
@_inputViewsByFace = {front: [], back: []}
focused = $('*:focus') # allow restoration of focus upon re-attachment
focused = $('input:focus') # allow restoration of focus upon re-attachment
for fieldName, destFace of product.attrs.layout
@_log("Moving", fieldName, "to", destFace)
viewEl = @_inputViews[fieldName].el.detach()
Expand All @@ -364,10 +364,10 @@ class Skeuocard
@_inputViews[fieldName].show()
# Restore focus. Use setTimeout to resolve IE10 issue.
setTimeout =>
fieldEl = focused.first()
fieldLength = fieldEl[0].maxLength
fieldEl.focus()
fieldEl[0].setSelectionRange(fieldLength, fieldLength)
if (fieldEl = focused.first())?
fieldLength = fieldEl[0].maxLength
fieldEl.focus()
fieldEl[0].setSelectionRange(fieldLength, fieldLength)
, 10
else
for fieldName, view of @_inputViews
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "Skeuocard",
"description": "A skeuomorphic credit-card input.",
"homepage": "http://github.com/kenkeiter/skeuocard",
"version": "1.0.2",
"version": "1.0.3",
"author": {
"name": "Ken Keiter",
"url": "http://kenkeiter.com/"
Expand Down

0 comments on commit 2d3067e

Please sign in to comment.