How to use the metal-dom.toElement function in metal-dom

To help you get started, we’ve selected a few metal-dom 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 metal / metal.js / packages / metal-component / src / Component.js View on Github external
attachElement(parentElement, siblingElement) {
		const element = this.element;
		if (element && (siblingElement || !element.parentNode)) {
			const parent =
				toElement(parentElement) || this.DEFAULT_ELEMENT_PARENT; // eslint-disable-line
			parent.insertBefore(element, toElement(siblingElement));
		}
	}
github metal / metal.js / packages / metal-component / src / Component.js View on Github external
attachElement(parentElement, siblingElement) {
		const element = this.element;
		if (element && (siblingElement || !element.parentNode)) {
			const parent =
				toElement(parentElement) || this.DEFAULT_ELEMENT_PARENT; // eslint-disable-line
			parent.insertBefore(element, toElement(siblingElement));
		}
	}
github metal / metal.js / packages / metal-component / src / Component.js View on Github external
getPortalElement_(portalElementSelector) {
		let portalElement = toElement(portalElementSelector);

		if (portalElement) {
			return portalElement;
		}

		if (
			portalElementSelector.indexOf('#') === 0 &&
			portalElementSelector.indexOf(' ') === -1
		) {
			portalElement = document.createElement('div');
			portalElement.setAttribute('id', portalElementSelector.slice(1));

			enterDocument(portalElement);
		}

		return portalElement;
github metal / metal.js / packages / metal-component / src / Component.js View on Github external
attachElement(opt_parentElement, opt_siblingElement) {
		const element = this.element;
		if (element && (opt_siblingElement || !element.parentNode)) {
			const parent = toElement(opt_parentElement) || this.DEFAULT_ELEMENT_PARENT;
			parent.insertBefore(element, toElement(opt_siblingElement));
		}
	}
github metal / metal.js / packages / metal-component / src / Component.js View on Github external
attachElement(opt_parentElement, opt_siblingElement) {
		const element = this.element;
		if (element && (opt_siblingElement || !element.parentNode)) {
			const parent = toElement(opt_parentElement) || this.DEFAULT_ELEMENT_PARENT;
			parent.insertBefore(element, toElement(opt_siblingElement));
		}
	}