Created
November 21, 2021 22:30
-
-
Save arturmkrtchyan/a08fad31bbcb2ea1eb35f50d6ee17198 to your computer and use it in GitHub Desktop.
Email label and Phone number fix
This file contains 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
<script> | |
document.addEventListener("DOMContentLoaded", function() { | |
setInterval(function() { | |
const telNumebers = $('.js-list-item a:contains("Url label")'); | |
telNumebers.each(function(){ | |
const number = $(this).attr('href'); | |
if(number == 'tel:') { | |
$(this).css('display', 'none'); | |
} else { | |
$(this).html(number.replace('tel:', '')); | |
} | |
}); | |
const emails = $('.js-list-item a:contains("Email to")'); | |
emails.each(function(){ | |
const email = $(this).attr('href'); | |
if(email == 'mailto:') { | |
$(this).css('display', 'none'); | |
} else { | |
$(this).html(email.replace('mailto:', '')); | |
} | |
}); | |
}, 300); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment