MCPcopy
hub / github.com/ampproject/amphtml / toggleRootDataAttribute

Function toggleRootDataAttribute

ads/google/ima/ima-video.js:205–213  ·  view source on GitHub ↗

* @param {string} state * @param {boolean} active

(state, active)

Source from the content-addressed store, hash-verified

203 * @param {boolean} active
204 */
205function toggleRootDataAttribute(state, active) {
206 const {'root': root} = elements;
207 const attributeName = `data-${state}`;
208 if (active) {
209 root.setAttribute(attributeName, '');
210 } else {
211 root.removeAttribute(attributeName);
212 }
213}
214
215/**
216 * @param {Document} elementOrDoc

Callers 7

onAdPausedFunction · 0.85
onAdResumedFunction · 0.85
playVideoFunction · 0.85
pauseVideoFunction · 0.85
toggleMutedFunction · 0.85
showAdControlsFunction · 0.85
resetControlsAfterAdFunction · 0.85

Calls 1

setAttributeMethod · 0.45

Tested by

no test coverage detected