diff --git a/docs/assets/js/application-scrollspy.js b/docs/assets/js/application-scrollspy.js deleted file mode 100644 index 1f0b7cebe2..0000000000 --- a/docs/assets/js/application-scrollspy.js +++ /dev/null @@ -1,39 +0,0 @@ -// scroll spy logic -// ================ -$(function () { - - var activeTarget, - position = {}, - $window = $(window), - nav = $('body > .topbar li a'), - targets = nav.map(function () { - return $(this).attr('href'); - }), - offsets = $.map(targets, function (id) { - return $(id).offset().top; - }); - - function setButton(id) { - nav.parent("li").removeClass('active'); - $(nav[$.inArray(id, targets)]).parent("li").addClass('active'); - } - - function processScroll(e) { - var scrollTop = $window.scrollTop() + 10, i; - for (i = offsets.length; i--;) { - if (activeTarget != targets[i] && scrollTop >= offsets[i] && (!offsets[i + 1] || scrollTop <= offsets[i + 1])) { - activeTarget = targets[i]; - setButton(activeTarget); - } - } - } - - nav.click(function () { - processScroll(); - }); - - processScroll(); - - $window.scroll(processScroll); - -}) \ No newline at end of file diff --git a/docs/assets/js/application.js b/docs/assets/js/application.js index 86eefa89d1..d1c6751ea2 100644 --- a/docs/assets/js/application.js +++ b/docs/assets/js/application.js @@ -6,6 +6,12 @@ $(document).ready(function(){ $('body').dropdown() // catch any dropdowns on the page + // Scrollspy + // ========= + + $('body > .topbar').scrollSpy() + + // table sort example // ================== diff --git a/docs/index.html b/docs/index.html index 4764edfb52..e19059d242 100644 --- a/docs/index.html +++ b/docs/index.html @@ -23,8 +23,8 @@ + - @@ -1591,6 +1591,10 @@ Lorem ipsum dolar sit amet illo error ipsum verita