Skip to content

Instantly share code, notes, and snippets.

@normanzb
Created December 18, 2015 19:43
Show Gist options
  • Save normanzb/decd1000a48a95ac5c9c to your computer and use it in GitHub Desktop.
Save normanzb/decd1000a48a95ac5c9c to your computer and use it in GitHub Desktop.
CQ stupidness
if (CQ_Analytics.Utils.teasersCache && CQ_Analytics.Utils.teasersCache[url]) {
showTeaser(CQ_Analytics.Utils.teasersCache[url]);
} else {
CQ_Analytics.Utils.teasersLoading = CQ_Analytics.Utils.teasersLoading || {};
//teaser might be alreading being loaded
if( CQ_Analytics.Utils.teasersLoading[url]) {
//"come back" in some few ms
window.setTimeout(function() {
CQ_Analytics.Utils.loadTeaserElement(url, elemId);
}, 100);
} else {
CQ_Analytics.Utils.teasersLoading[url] = true;
loadTeaser();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment