Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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));
}
}
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));
}
}
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;
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));
}
}
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));
}
}