MCPcopy Create free account
hub / github.com/ReactTooltip/react-tooltip / handleLoadAds

Function handleLoadAds

docs/static/js/gpt.js:29–48  ·  view source on GitHub ↗
(event)

Source from the content-addressed store, hash-verified

27})
28
29const handleLoadAds = (event) => {
30 const { id } = event.detail
31
32 if (window.innerWidth < 1024 && !id.includes('anchor')) {
33 return
34 }
35
36 window.googletag.cmd.push(function () {
37 if (window.reactTooltipAds.initialized[id]) {
38 window.googletag.cmd.push(function () {
39 window.googletag.pubads().refresh()
40 })
41
42 window.googletag.display(id)
43 } else {
44 window.googletag.display(id)
45 window.reactTooltipAds.initialized[id] = true
46 }
47 })
48}
49
50window.addEventListener('AdsContainerMounted', handleLoadAds)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected