diff --git a/src/js/03-fragment-jumper.js b/src/js/03-fragment-jumper.js deleted file mode 100644 index 45f037c2..00000000 --- a/src/js/03-fragment-jumper.js +++ /dev/null @@ -1,41 +0,0 @@ -;(function () { - 'use strict' - - var article = document.querySelector('article.doc') - var supportsScrollToOptions = 'scrollTo' in document.documentElement - - function decodeFragment (hash) { - return hash && (~hash.indexOf('%') ? decodeURIComponent(hash) : hash).slice(1) - } - - function computePosition (el, sum) { - return article.contains(el) ? computePosition(el.offsetParent, el.offsetTop + sum) : sum - } - - function jumpToAnchor (e) { - if (e) { - if (e.altKey || e.ctrlKey) return - window.location.hash = '#' + this.id - e.preventDefault() - } - var y = computePosition(this, 0) - var instant = e === false && supportsScrollToOptions - instant ? window.scrollTo({ left: 0, top: y, behavior: 'instant' }) : window.scrollTo(0, y) - } - - window.addEventListener('load', function jumpOnLoad (e) { - var fragment, target - if ((fragment = decodeFragment(window.location.hash)) && (target = document.getElementById(fragment))) { - jumpToAnchor.call(target, false) - setTimeout(jumpToAnchor.bind(target, false), 250) - } - window.removeEventListener('load', jumpOnLoad) - }) - - Array.prototype.slice.call(document.querySelectorAll('a[href^="#"]')).forEach(function (el) { - var fragment, target - if ((fragment = decodeFragment(el.hash)) && (target = document.getElementById(fragment))) { - el.addEventListener('click', jumpToAnchor.bind(target)) - } - }) -})() diff --git a/src/js/04-theme-toggle.js b/src/js/03-theme-toggle.js similarity index 100% rename from src/js/04-theme-toggle.js rename to src/js/03-theme-toggle.js diff --git a/src/js/05-segment-analytics.js b/src/js/04-segment-analytics.js similarity index 100% rename from src/js/05-segment-analytics.js rename to src/js/04-segment-analytics.js diff --git a/src/js/06-feedback-dialog.js b/src/js/05-feedback-dialog.js similarity index 100% rename from src/js/06-feedback-dialog.js rename to src/js/05-feedback-dialog.js diff --git a/src/js/07-intercom.js b/src/js/06-intercom.js similarity index 100% rename from src/js/07-intercom.js rename to src/js/06-intercom.js diff --git a/src/js/08-copy-to-clipboard.js b/src/js/07-copy-to-clipboard.js similarity index 100% rename from src/js/08-copy-to-clipboard.js rename to src/js/07-copy-to-clipboard.js