Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- (function () {
- if (window.Element && !Element.prototype.closest) {
- Element.prototype.closest = function(s) {
- var matches = (this.document || this.ownerDocument).querySelectorAll(s),
- i,
- el = this;
- do {
- i = matches.length;
- while (--i >= 0 && matches.item(i) !== el) {};
- } while ((i < 0) && (el = el.parentElement));
- return el;
- };
- }
- var i = 100;
- function waitForHideForm() {
- var form = document.querySelector("#myForm");
- if (form.offsetHeight > 0 && i > 0) {
- i--;
- setTimeout(waitForHideForm, 100);
- } else {
- var detailsBlock = document.querySelector('#AfibersSectionLead .sucMsg');
- if (detailsBlock && !detailsBlock.parentNode.parentNode.classList.contains('ng-hide')) {
- adoric.trigger('address_valid');
- }
- }
- }
- document.querySelector('body').addEventListener('click', function(event) {
- var ctaButton = event.target.closest('#sendBtn');
- if(ctaButton) {
- waitForHideForm();
- }
- });
- })();
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement