Sha256: 49c6b33e6b79aa8dd0333239c75640b1b2971fcca49ba277c72a4c411f684564

Contents?: true

Size: 865 Bytes

Versions: 1

Compression:

Stored size: 865 Bytes

Contents

/* eslint-disable */

export function div(className) {
  const div = document.createElement('div');
  div.className = className;
  return div;
}

const elMatches =
  typeof Element !== 'undefined' &&
  (Element.prototype.matches ||
    Element.prototype.webkitMatchesSelector ||
    Element.prototype.mozMatchesSelector ||
    Element.prototype.msMatchesSelector);

export function matches(element, query) {
  if (!elMatches) {
    throw new Error('No element matching method supported');
  }

  return elMatches.call(element, query);
}

export function remove(element) {
  if (element.remove) {
    element.remove();
  } else {
    if (element.parentNode) {
      element.parentNode.removeChild(element);
    }
  }
}

export function queryChildren(element, selector) {
  return Array.prototype.filter.call(element.children, (child) => matches(child, selector));
}

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jekyll-rubin-collab-theme-0.1.1 _third_party/mdb-ui-kit/src/js/mdb/perfect-scrollbar/lib/dom.js