Current Path : /var/www/www-root/data/www/info.monolith-realty.ru/bitrix/js/main/polyfill/closest/js/ |
Current File : /var/www/www-root/data/www/info.monolith-realty.ru/bitrix/js/main/polyfill/closest/js/closest.js |
;(function() { 'use strict'; if (!Element.prototype.closest) { /** * Finds closest parent element by selector * @param {string} selector * @return {HTMLElement|Element|Node} */ Object.defineProperty(Element.prototype, 'closest', { enumerable: false, value: function(selector) { var node = this; while (node) { if (node.matches(selector)) { return node; } node = node.parentElement; } return null; }, }); } })();