How to use the belter/src.hideElement 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 krakenjs / zoid / src / component / parent / index.js View on Github external
}

                return;
            }

            let outlet = document.createElement('div');
            addClass(outlet, CLASS_NAMES.OUTLET);

            let container = this.renderTemplate(this.component.containerTemplate, { context, uid, container: el, focus, outlet });

            if (container instanceof ElementNode) {
                container = container.render(dom({ doc: document }));
            }

            this.container = container;
            hideElement(this.container);
            appendChild(el, this.container);

            if (this.driver.renderedIntoContainer) {
                this.element = outlet;
                hideElement(this.element);

                if (!this.element) {
                    throw new Error('Could not find element to render component into');
                }

                hideElement(this.element);
            }

            this.clean.register('destroyContainerTemplate', () => {

                if (this.container && this.container.parentNode) {
github krakenjs / zoid / dist / module / component / parent / index.js View on Github external
}

                return;
            }

            var outlet = document.createElement('div');
            addClass(outlet, CLASS_NAMES.OUTLET);

            var container = _this29.renderTemplate(_this29.component.containerTemplate, { context: context, uid: uid, container: el, focus: focus, outlet: outlet });

            if (container instanceof ElementNode) {
                container = container.render(dom({ doc: document }));
            }

            _this29.container = container;
            hideElement(_this29.container);
            appendChild(el, _this29.container);

            if (_this29.driver.renderedIntoContainer) {
                _this29.element = outlet;
                hideElement(_this29.element);

                if (!_this29.element) {
                    throw new Error('Could not find element to render component into');
                }

                hideElement(_this29.element);
            }

            _this29.clean.register('destroyContainerTemplate', function () {

                if (_this29.container && _this29.container.parentNode) {
github krakenjs / zoid / src / component / parent / index.js View on Github external
let outlet = document.createElement('div');
            addClass(outlet, CLASS_NAMES.OUTLET);

            let container = this.renderTemplate(this.component.containerTemplate, { context, uid, container: el, focus, outlet });

            if (container instanceof ElementNode) {
                container = container.render(dom({ doc: document }));
            }

            this.container = container;
            hideElement(this.container);
            appendChild(el, this.container);

            if (this.driver.renderedIntoContainer) {
                this.element = outlet;
                hideElement(this.element);

                if (!this.element) {
                    throw new Error('Could not find element to render component into');
                }

                hideElement(this.element);
            }

            this.clean.register('destroyContainerTemplate', () => {

                if (this.container && this.container.parentNode) {
                    this.container.parentNode.removeChild(this.container);
                }

                delete this.container;
            });
github krakenjs / zoid / dist / module / component / parent / index.js View on Github external
var outlet = document.createElement('div');
            addClass(outlet, CLASS_NAMES.OUTLET);

            var container = _this29.renderTemplate(_this29.component.containerTemplate, { context: context, uid: uid, container: el, focus: focus, outlet: outlet });

            if (container instanceof ElementNode) {
                container = container.render(dom({ doc: document }));
            }

            _this29.container = container;
            hideElement(_this29.container);
            appendChild(el, _this29.container);

            if (_this29.driver.renderedIntoContainer) {
                _this29.element = outlet;
                hideElement(_this29.element);

                if (!_this29.element) {
                    throw new Error('Could not find element to render component into');
                }

                hideElement(_this29.element);
            }

            _this29.clean.register('destroyContainerTemplate', function () {

                if (_this29.container && _this29.container.parentNode) {
                    _this29.container.parentNode.removeChild(_this29.container);
                }

                delete _this29.container;
            });
github krakenjs / zoid / dist / module / component / parent / index.js View on Github external
ParentComponent.prototype.hide = function hide() {

        if (this.container) {
            hideElement(this.container);
        }

        return this.driver.hide.call(this);
    };
github krakenjs / zoid / src / parent / index.js View on Github external
}).then(({ container, frame, prerenderFrame }) => {
            const innerContainer = this.renderTemplate(this.component.containerTemplate, { context, uid, container, frame, prerenderFrame, doc: document });
            if (innerContainer) {
                if (!visible) {
                    hideElement(innerContainer);
                }
                appendChild(container, innerContainer);
                this.clean.register(() => destroyElement(innerContainer));
                this.proxyContainer = getProxyObject(innerContainer);
                return getProxyObject(innerContainer);
            }
        });
    }
github krakenjs / zoid / src / component / parent / index.js View on Github external
hide() : void {

        if (this.container) {
            hideElement(this.container);
        }

        return this.driver.hide.call(this);
    }
github krakenjs / zoid / dist / module / component / parent / drivers.js View on Github external
hide: function hide() {
        hideElement(this.element);
    }
};