can you try
window.laytheme.on('content_ready', typeOfContentThatIsReady, $target, isProjectOverlayObj){
}
typeOfContentThatIsReady
will be desktop or phone
$target will be any containers that include gridder grids
So all javascript changes / event listeners you could have made / bound to existing elements are gone.
If you bind event listeners in a delegated way to document like described here:
https://laytheme.com/documentation/custom-javascript.html#binding-click-events
<script>
jQuery(document).on("click", ".clickme", function(event) {
console.log("yay!");
});
</script>
then no dom changes will alter these binds