by the badge's height plus its offset, on top
* of the padding the site already has, so the badge never covers the
* footer. Again on resize: the badge wraps on narrow screens.
*/
function reserveSpace(host) {
var body = document.body;
var sitePadding = parseFloat(window.getComputedStyle(body).paddingBottom) || 0;
function apply() {
var height = host.getBoundingClientRect().height;
body.style.setProperty('padding-bottom', (sitePadding + height + OFFSET) + 'px', 'important');
}
apply();
window.addEventListener('resize', apply);
}
/** Draw the badge when core says it's on for this site. */
function draw(data) {
var href = data && data.enabled === true ? badgeHref(data) : '';
if (!href || document.querySelector(TAG)) {
return;
}
var host = buildHost(buildLink(href, offerText(data)));
document.body.appendChild(host);
reserveSpace(host);
}
function start() {
try {
fetchBadge(badgeUrl(config.apiBase, config.domainId))
.then(draw)
.catch(function () {});
} catch (e) {
// Nothing to show and nothing to log.
}
}
if (!config || !config.apiBase || !config.domainId || typeof window.fetch !== 'function'
|| typeof document.documentElement.attachShadow !== 'function') {
return;
}
if (document.body) {
start();
} else {
document.addEventListener('DOMContentLoaded', start);
}
}))({"apiBase":"https:\/\/core.10web.io\/public\/api","domainId":1722769,"logoUrl":"https:\/\/lushfashionstore.com\/wp-content\/themes\/wvc-theme\/includes\/partner-badge\/10web-logo.svg","dotUrl":"https:\/\/lushfashionstore.com\/wp-content\/themes\/wvc-theme\/includes\/partner-badge\/dot.svg"});