Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REF] Cleanup billingBlock.js #22713

Merged
merged 1 commit into from
Feb 11, 2022

Conversation

colemanw
Copy link
Member

@colemanw colemanw commented Feb 5, 2022

Overview

Code cleanup in billingBlock.js

Before

Code messier - unnecessary functions, deprecated variables, malformed html

After

Code neater

@civibot
Copy link

civibot bot commented Feb 5, 2022

(Standard links)

@civibot civibot bot added the master label Feb 5, 2022
function civicrm_billingblock_creditcard_helper() {
$(function() {
$.each(CRM.config.creditCardTypes, function(key, val) {
var html = '<a href="#" data-card_type=" + key + " title="' + val + '" class="crm-credit_card_type-icon-' + val.css_key + '"><span>' + val.label + '</span></a>';
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note data-card_type was never set correctly due to bad js concatenation here, so it's obviously unused and not needed.


civicrm_billingblock_creditcard_helper();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was silly. The function just called another function.

@colemanw colemanw force-pushed the billingBlockCleanup branch from 7dc4409 to 8c2b268 Compare February 5, 2022 18:38
@braders
Copy link
Contributor

braders commented Feb 5, 2022

This looks much better 👍

@colemanw colemanw added the merge ready PR will be merged after a few days if there are no objections label Feb 5, 2022
@seamuslee001
Copy link
Contributor

This has been merge ready for a few days merging now

@seamuslee001 seamuslee001 merged commit 4041251 into civicrm:master Feb 11, 2022
@seamuslee001 seamuslee001 deleted the billingBlockCleanup branch February 11, 2022 06:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
master merge ready PR will be merged after a few days if there are no objections
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants