How to use the belter/src.getElement function in belter

To help you get started, we’ve selected a few belter examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github paypal / paypal-checkout-components / test / integration / windows / button / index.jsx View on Github external
setTimeout(() => {
                getElement(selector || '.paypal-button', document).click();
            }, delay);
        } else {
github krakenjs / zoid / src / component / parent / index.js View on Github external
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;
            }
github krakenjs / zoid / dist / module / component / parent / index.js View on Github external
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 });
                }
            });
        });
github krakenjs / zoid / src / component / parent / index.js View on Github external
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 });
                }
            });
        });
github krakenjs / zoid / dist / module / component / parent / index.js View on Github external
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;
            }
github krakenjs / zoid / dist / module / component / child / index.js View on Github external
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 };
    };