Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
click() {
getElement('.paypal-button', document).click();
}
});
setTimeout(() => {
getElement(selector || '.paypal-button', document).click();
}, delay);
} else {
return ZalgoPromise.try(() => {
let el;
if (element) {
el = getElement(element);
} else {
el = document.body;
}
if (!el) {
throw new Error(`Could not find element to open container into`);
}
if (!this.component.containerTemplate) {
if (this.driver.renderedIntoContainer) {
throw new Error(`containerTemplate needed to render ${ context }`);
}
return;
}
try {
writeElementToWindow(prerenderWindow, el);
} catch (err) {
return;
}
var _ref12 = _this27.component.autoResize || {},
_ref12$width = _ref12.width,
width = _ref12$width === undefined ? false : _ref12$width,
_ref12$height = _ref12.height,
height = _ref12$height === undefined ? false : _ref12$height,
_ref12$element = _ref12.element,
element = _ref12$element === undefined ? 'body' : _ref12$element;
if (width || height) {
onResize(getElement(element, prerenderWindow.document), function (_ref13) {
var newWidth = _ref13.width,
newHeight = _ref13.height;
_this27.resize({
width: width ? newWidth : undefined,
height: height ? newHeight : undefined
});
}, { width: width, height: height, win: prerenderWindow });
}
});
});
let el = this.renderTemplate(this.component.prerenderTemplate, { context, uid, document: doc });
if (el instanceof ElementNode) {
el = el.render(dom({ doc }));
}
try {
writeElementToWindow(prerenderWindow, el);
} catch (err) {
return;
}
let { width = false, height = false, element = 'body' } = this.component.autoResize || {};
if (width || height) {
onResize(getElement(element, prerenderWindow.document), ({ width: newWidth, height: newHeight }) => {
this.resize({
width: width ? newWidth : undefined,
height: height ? newHeight : undefined
});
}, { width, height, win: prerenderWindow });
}
});
});
return ZalgoPromise['try'](function () {
var el = void 0;
if (element) {
el = getElement(element);
} else {
el = document.body;
}
if (!el) {
throw new Error('Could not find element to open container into');
}
if (!_this29.component.containerTemplate) {
if (_this29.driver.renderedIntoContainer) {
throw new Error('containerTemplate needed to render ' + context);
}
return;
}
ChildComponent.prototype.getAutoResize = function getAutoResize() {
var _ref3 = this.autoResize || this.component.autoResize || {},
_ref3$width = _ref3.width,
width = _ref3$width === undefined ? false : _ref3$width,
_ref3$height = _ref3.height,
height = _ref3$height === undefined ? false : _ref3$height,
_ref3$element = _ref3.element,
element = _ref3$element === undefined ? 'body' : _ref3$element;
element = getElement(element);
return { width: width, height: height, element: element };
};