Sha256: 020a65918319ea4490937445542827f12ac83b676056f6a4895faf4240ae4ded
Contents?: true
Size: 1.01 KB
Versions: 75
Compression:
Stored size: 1.01 KB
Contents
{"version":3,"file":"closest-attribute-value.mjs","sources":["../../../src/govuk/common/closest-attribute-value.mjs"],"sourcesContent":["import '../vendor/polyfills/Element/prototype/closest.mjs'\n\n/**\n * Returns the value of the given attribute closest to the given element (including itself)\n *\n * @deprecated Will be made private in v5.0\n * @param {Element} $element - The element to start walking the DOM tree up\n * @param {string} attributeName - The name of the attribute\n * @returns {string | null} Attribute value\n */\nexport function closestAttributeValue ($element, attributeName) {\n var $closestElementWithAttribute = $element.closest('[' + attributeName + ']')\n return $closestElementWithAttribute\n ? $closestElementWithAttribute.getAttribute(attributeName)\n : null\n}\n"],"names":[],"mappings":";;AAEA;;;;;;;;AAQA,AAAO,SAAS,qBAAqB,EAAE,QAAQ,EAAE,aAAa,EAAE;EAC9D,IAAI,4BAA4B,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,GAAG,aAAa,GAAG,GAAG,EAAC;EAC9E,OAAO,4BAA4B;MAC/B,4BAA4B,CAAC,YAAY,CAAC,aAAa,CAAC;MACxD,IAAI;CACT;;;;"}
Version data entries
75 entries across 75 versions & 1 rubygems