Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: src/js/vendor/element-closest.js

Issue 29624561: Issue 6104 - Minified code in help center repository (Closed) Base URL: https://hg.adblockplus.org/help.eyeo.com
Patch Set: Fix sourcemaps for CSS files, Change tabs to spaces Created Nov. 30, 2017, 10:03 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/js/vendor/classList.js ('k') | src/js/vendor/html5shiv.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*! @source https://github.com/jonathantneal/closest/blob/master/element-closest .js */
2
3 (function (ElementProto) {
4 if (typeof ElementProto.matches !== 'function') {
5 ElementProto.matches = ElementProto.msMatchesSelector || Element Proto.mozMatchesSelector || ElementProto.webkitMatchesSelector || function match es(selector) {
6 var element = this;
7 var elements = (element.document || element.ownerDocumen t).querySelectorAll(selector);
8 var index = 0;
9
10 while (elements[index] && elements[index] !== element) {
11 ++index;
12 }
13
14 return Boolean(elements[index]);
15 };
16 }
17
18 if (typeof ElementProto.closest !== 'function') {
19 ElementProto.closest = function closest(selector) {
20 var element = this;
21
22 while (element && element.nodeType === 1) {
23 if (element.matches(selector)) {
24 return element;
25 }
26
27 element = element.parentNode;
28 }
29
30 return null;
31 };
32 }
33 })(window.Element.prototype);
OLDNEW
« no previous file with comments | « src/js/vendor/classList.js ('k') | src/js/vendor/html5shiv.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld