diff --git a/Dockerfile.prod b/Dockerfile.prod index 8be911c05fb..76883d6a6ea 100644 --- a/Dockerfile.prod +++ b/Dockerfile.prod @@ -36,4 +36,5 @@ RUN stat /run/public/index.html FROM nginx VOLUME /usr/share/nginx/html/docs COPY --from=build /run/public /usr/share/nginx/html/docs/ +COPY gulpfile.babel.js /usr/share/nginx/html/docs/ COPY nginx.conf /etc/nginx/conf.d/default.conf diff --git a/Dockerfile.staging b/Dockerfile.staging index 2cd841f0991..e13c6d16a1e 100644 --- a/Dockerfile.staging +++ b/Dockerfile.staging @@ -35,4 +35,5 @@ RUN stat /run/public/index.html FROM nginx VOLUME /usr/share/nginx/html/docs COPY --from=build /run/public /usr/share/nginx/html/docs/ +COPY gulpfile.babel.js /usr/share/nginx/html/docs/ COPY nginx.conf /etc/nginx/conf.d/default.conf diff --git a/src/js/app.js b/src/js/app.js index 20d939de907..d5780117d18 100644 --- a/src/js/app.js +++ b/src/js/app.js @@ -65,18 +65,26 @@ const bootstrapDocsSearch = function() { overlay.toggleClass('open'); if (container.hasClass('open')) { - $('input#search').focus(); + $('input#search-box').focus(); } overlay.css({top: 120}); }); - } -const bootstrapDocsJS = function() { - bootstrapDocsSearch(); +const bootstrapIdLinks = function() { + const container = '.wrapper ARTICLE'; + const selector = 'h2[id], h3[id], h4[id], h5[id], h6[id]'; + $(container).on('mouseenter', selector, function(e) { + $(e.target).append($('').addClass('header-anchor').attr('href', '#' + e.target.id).html('')); + }); + + $(container).on('mouseleave', selector, function(e) { + $(e.target).parent().find('.header-anchor').remove(); + }); } $(document).ready(() => { - bootstrapDocsJS(); + bootstrapDocsSearch(); + bootstrapIdLinks(); });