MCPcopy
hub / github.com/Justineo/github-hovercard / bodyContains

Function bodyContains

extensions/edge/tooltipster.js:2014–2019  ·  view source on GitHub ↗

* A fast function to check if an element is still in the DOM. It * tries to use an id as ids are indexed by the browser, or falls * back to jQuery's `contains` method. * * @param {string|object} ref An id or a jQuery-wrapped HTML element * @return {boolean}

(ref)

Source from the content-addressed store, hash-verified

2012 * @return {boolean}
2013 */
2014 function bodyContains(ref) {
2015
2016 var id = (typeof ref === 'string') ? ref : ref.attr('id');
2017
2018 return id ? !!document.getElementById(id) : $.contains(document.body, ref[0]);
2019 }
2020})(jQuery);
2021
2022

Callers 1

tooltipster.jsFile · 0.70

Calls 1

containsMethod · 0.80

Tested by

no test coverage detected