How to use the sizzle.matchesSelector function in sizzle

To help you get started, we’ve selected a few sizzle 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 instructure / instructure-ui / packages / ui-test-utils / src / utils / selectors.js View on Github external
function matches (element, selector, options) {
  addPseudos(options)
  return element && Sizzle.matchesSelector(element, selector)
}
github rvagg / archived-traversty / test / integration / ender_sizzle.js View on Github external
, is = function (s) {
          var i, l
          for (i = 0, l = this.length; i < l; i++) {
            if (sizzle.matchesSelector(this[i], s))
              return true
          }
          return false
        }
github conversejs / converse.js / src / utils / html.js View on Github external
u.getFirstChildElement = function (el, selector='*') {
    let first_el = el.firstElementChild;
    while (first_el !== null && !sizzle.matchesSelector(first_el, selector)) {
        first_el = first_el.nextElementSibling
    }
    return first_el;
}
github conversejs / converse.js / src / utils / html.js View on Github external
u.getLastChildElement = function (el, selector='*') {
    let last_el = el.lastElementChild;
    while (last_el !== null && !sizzle.matchesSelector(last_el, selector)) {
        last_el = last_el.previousElementSibling
    }
    return last_el;
}
github conversejs / converse.js / src / utils / html.js View on Github external
u.ancestor = function (el, selector) {
    let parent = el;
    while (parent !== null && !sizzle.matchesSelector(parent, selector)) {
        parent = parent.parentElement;
    }
    return parent;
}
github conversejs / converse.js / src / utils / html.js View on Github external
u.getNextElement = function (el, selector='*') {
    let next_el = el.nextElementSibling;
    while (next_el !== null && !sizzle.matchesSelector(next_el, selector)) {
        next_el = next_el.nextElementSibling;
    }
    return next_el;
}
github conversejs / converse.js / src / utils / html.js View on Github external
u.getPreviousElement = function (el, selector='*') {
    let prev_el = el.previousElementSibling;
    while (prev_el !== null && !sizzle.matchesSelector(prev_el, selector)) {
        prev_el = prev_el.previousElementSibling
    }
    return prev_el;
}

sizzle

A pure-JavaScript, bottom-up CSS selector engine designed to be easily dropped in to a host library.

MIT
Latest version published 2 years ago

Package Health Score

65 / 100
Full package analysis