Skip to content

Commit

Permalink
addressed js lint issues #6207
Browse files Browse the repository at this point in the history
  • Loading branch information
bka committed May 21, 2017
1 parent 9465b0e commit 3fc2f9e
Showing 1 changed file with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,21 @@ define([
/**
* build a unique id for the term checkbox
*
* @param {Object} ko context
* @param {Int} agreementId
* @param {Object} context - the ko context
* @param {Number} agreementId
*/
getCheckboxId: function(context, agreementId) {
var paymentMethodName = '';
// fetch corresponding payment method from parent context
var paymentMethodRenderer = context.$parents[1];
getCheckboxId: function (context, agreementId) {
var paymentMethodName = '',
paymentMethodRenderer = context.$parents[1];

if (paymentMethodRenderer) {
// item looks like this: {title: "Check / Money order", method: "checkmo"}
paymentMethodName = (paymentMethodRenderer.item) ?
paymentMethodRenderer.item.method : '';
}
return 'agreement_' + paymentMethodName + '_' + agreementId;
// corresponding payment method fetched from parent context
if (paymentMethodRenderer) {
// item looks like this: {title: "Check / Money order", method: "checkmo"}
paymentMethodName = paymentMethodRenderer.item ?
paymentMethodRenderer.item.method : '';
}

return 'agreement_' + paymentMethodName + '_' + agreementId;
},

/**
Expand Down

0 comments on commit 3fc2f9e

Please sign in to comment.