- commit
- 9eca17672615466a2508815040447c8675c8bf2b
- parent
- 48f82a0024019ed21589f3947c7b39b2fad81382
- Author
- Tobias Bengfort <tobias.bengfort@posteo.de>
- Date
- 2018-08-07 20:59
do not include polyfill
Diffstat
| M | smooth-scroll.js | 19 | ------------------- |
1 files changed, 0 insertions, 19 deletions
diff --git a/smooth-scroll.js b/smooth-scroll.js
@@ -11,25 +11,6 @@ 11 11 })(function() { 12 12 'use strict'; 13 1314 -1 Element.prototype.closest =15 -1 Element.prototype.closest ||16 -1 function(selector) {17 -1 var matches = document.querySelectorAll(selector);18 -119 -1 var fn = function(el) {20 -1 if (el) {21 -1 for (var i = 0; i < matches.length; i++) {22 -1 if (matches[i] === el) {23 -1 return el;24 -1 }25 -1 }26 -1 return fn(el.parentElement);27 -1 }28 -1 };29 -130 -1 return fn(this);31 -1 };32 -133 14 var delegated = function(element, eventType, selector, handler) { 34 15 element.addEventListener(eventType, function(event) { 35 16 var target = event.target.closest(selector);