Created
March 30, 2019 21:22
-
-
Save brickbones/cff26bd325b94af42df755b73e0d3cf4 to your computer and use it in GitHub Desktop.
Cleave.js settings
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new Cleave('.account', { | |
prefix: 'IEAT', | |
delimiter: '-', | |
blocks: [4,4], | |
uppercase: true | |
}); | |
new Cleave('.donation', { | |
numeral: true, | |
numeralThousandGroupStyle: 'thousand' | |
}) | |
new Cleave('.creditcard', { | |
creditCard: true, | |
delimiter: '-', | |
onCreditCardTypeChanged: function (type) { | |
if(type === 'visa'){ | |
document.querySelector('.fa-cc-visa').classList.add('active'); | |
} else { | |
document.querySelector('.fa-cc-visa').classList.remove('active'); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment