MCPcopy Create free account
hub / github.com/ampproject/amphtml / sortable

Function sortable

ads/vendors/sortable.js:7–22  ·  view source on GitHub ↗
(global, data)

Source from the content-addressed store, hash-verified

5 * @param {!Object} data
6 */
7export function sortable(global, data) {
8 validateData(data, ['site', 'name'], ['responsive']);
9
10 const slot = global.document.getElementById('c');
11 const ad = global.document.createElement('div');
12 const size =
13 data.responsive === 'true' ? 'auto' : data.width + 'x' + data.height;
14 ad.className = 'ad-tag';
15 ad.setAttribute('data-ad-name', data.name);
16 ad.setAttribute('data-ad-size', size);
17 slot.appendChild(ad);
18 loadScript(
19 global,
20 'https://tags-cdn.deployads.com/a/' + encodeURIComponent(data.site) + '.js'
21 );
22}

Callers

nothing calls this directly

Calls 4

validateDataFunction · 0.90
loadScriptFunction · 0.90
getElementByIdMethod · 0.45
setAttributeMethod · 0.45

Tested by

no test coverage detected