You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dropping this information here in case someone else has trouble integrating LiveZilla into their Turbolinks 5 based Rails application.
Official Documentation: <!-- livezilla.net PLACE SOMEWHERE IN BODY --><script type="text/javascript" id="lzdefsc" src="//yourdomain.com/script.php?id=lzdefsc" defer></script><!-- livezilla.net PLACE SOMEWHERE IN BODY -->
Turbolinks 5 Implementation:
<!-- livezilla.net PLACE SOMEWHERE IN HEAD --><script type="text/javascript" id="lzdefsc" src="//yourdomain.com/script.php?id=lzdefsc" defer></script><!-- livezilla.net PLACE SOMEWHERE IN HEAD -->
your.js
document.addEventListener("turbolinks:before-cache", function() {
LiveZillaElements = findandgrabLiveZillaDomElements();
});
function findandgrabLiveZillaDomElements(){
elements = []
if(document.getElementById("lz_overlay_chat")){
elements.push(document.getElementById("lz_overlay_chat"));
}
if(document.getElementById("lz_overlay_wm")){
elements.push(document.getElementById("lz_overlay_wm"));
}
if(document.getElementById("lz_overlay_preview")){
elements.push(document.getElementById("lz_overlay_preview"));
}
return elements
}
document.addEventListener('turbolinks:load', function() {
if(LiveZillaElements.length){
var body = document.getElementsByTagName("body")[0]
for(var i=0;i<LiveZillaElements.length;i++){
body.appendChild(LiveZillaElements[i]);
}
}
});
The text was updated successfully, but these errors were encountered:
Dropping this information here in case someone else has trouble integrating LiveZilla into their Turbolinks 5 based Rails application.
Official Documentation:
<!-- livezilla.net PLACE SOMEWHERE IN BODY --><script type="text/javascript" id="lzdefsc" src="//yourdomain.com/script.php?id=lzdefsc" defer></script><!-- livezilla.net PLACE SOMEWHERE IN BODY -->
Turbolinks 5 Implementation:
<!-- livezilla.net PLACE SOMEWHERE IN HEAD --><script type="text/javascript" id="lzdefsc" src="//yourdomain.com/script.php?id=lzdefsc" defer></script><!-- livezilla.net PLACE SOMEWHERE IN HEAD -->
your.js
The text was updated successfully, but these errors were encountered: