From 455148c9ec161f8bf46237a057e6708a1cbbc106 Mon Sep 17 00:00:00 2001 From: Vincent Fiduccia Date: Mon, 9 Jul 2018 17:25:36 -0700 Subject: [PATCH 1/4] Focus search on click --- src/js/app.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/js/app.js b/src/js/app.js index 20d939de907..81ee65d8e32 100644 --- a/src/js/app.js +++ b/src/js/app.js @@ -65,7 +65,9 @@ const bootstrapDocsSearch = function() { overlay.toggleClass('open'); if (container.hasClass('open')) { - $('input#search').focus(); + console.log('hi'); + $('input#search-box').focus(); + console.log('hi2'); } overlay.css({top: 120}); From 3ad6ae52ee8a2cdb3d716ffe9ebdeb7ce874088d Mon Sep 17 00:00:00 2001 From: Vincent Fiduccia Date: Tue, 10 Jul 2018 11:54:06 -0700 Subject: [PATCH 2/4] Add anchor links to headers on hover --- src/js/app.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/js/app.js b/src/js/app.js index 81ee65d8e32..dd7b4cfbfc7 100644 --- a/src/js/app.js +++ b/src/js/app.js @@ -72,13 +72,21 @@ const bootstrapDocsSearch = function() { 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(); }); From 583d6bb4bd52a8ee940d8d13a24dcb08e434066d Mon Sep 17 00:00:00 2001 From: Vincent Fiduccia Date: Tue, 10 Jul 2018 12:22:44 -0700 Subject: [PATCH 3/4] Copy gulpfile for algolia --- Dockerfile.prod | 1 + Dockerfile.staging | 1 + 2 files changed, 2 insertions(+) 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 From 17a4675a66c90524774d7933bb02f7ca7524767c Mon Sep 17 00:00:00 2001 From: Vincent Fiduccia Date: Tue, 10 Jul 2018 12:24:12 -0700 Subject: [PATCH 4/4] Remove log --- src/js/app.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/js/app.js b/src/js/app.js index dd7b4cfbfc7..d5780117d18 100644 --- a/src/js/app.js +++ b/src/js/app.js @@ -65,9 +65,7 @@ const bootstrapDocsSearch = function() { overlay.toggleClass('open'); if (container.hasClass('open')) { - console.log('hi'); $('input#search-box').focus(); - console.log('hi2'); } overlay.css({top: 120});