From ae15fe5b0d0ed3748d2d3ce4a7be8ed43f6d9bb8 Mon Sep 17 00:00:00 2001 From: Ian Maddaus Date: Fri, 6 Dec 2024 15:51:58 -0500 Subject: [PATCH] Update site theme (#4351) Signed-off-by: Ian Maddaus --- .../assets/js/swiftype-config.js | 17 ++++++++++++----- .../assets/sass/partials/_swiftype_search.scss | 1 + _vendor/modules.txt | 2 +- go.mod | 2 +- go.sum | 4 ++-- 5 files changed, 17 insertions(+), 9 deletions(-) diff --git a/_vendor/github.com/chef/chef-docs-theme/assets/js/swiftype-config.js b/_vendor/github.com/chef/chef-docs-theme/assets/js/swiftype-config.js index 29e373ea9f..c310c08d6d 100644 --- a/_vendor/github.com/chef/chef-docs-theme/assets/js/swiftype-config.js +++ b/_vendor/github.com/chef/chef-docs-theme/assets/js/swiftype-config.js @@ -67,11 +67,18 @@ $(document).ready(function() { // on pressing enter key, navigate to search page and submit search string $("input.swiftype-search-input").on('keypress', function (event) { if (event.keycode == 13 || event.which == 13) { - event.preventDefault(); - window.location.href = "/search/#stq=" + encodeURIComponent($(this).val()) + '&stp=1'; - hideSearchModal(); - }; - }); + event.preventDefault(); + window.location.href = "/search/#stq=" + encodeURIComponent($(this).val()) + '&stp=1'; + hideSearchModal(); + }; + }); + + // on clicking modal search button, navigate to search page and submit search string + $("#swiftype-search-form-modal-input-search").click(function(){ + const searchInput = $("input#swiftype-search-form-modal-input").val() + window.location.href = "/search/#stq=" + encodeURIComponent(searchInput) + '&stp=1'; + hideSearchModal(); + }); /////////////////////////////////// // diff --git a/_vendor/github.com/chef/chef-docs-theme/assets/sass/partials/_swiftype_search.scss b/_vendor/github.com/chef/chef-docs-theme/assets/sass/partials/_swiftype_search.scss index 571e1a8258..a547b301f8 100644 --- a/_vendor/github.com/chef/chef-docs-theme/assets/sass/partials/_swiftype_search.scss +++ b/_vendor/github.com/chef/chef-docs-theme/assets/sass/partials/_swiftype_search.scss @@ -6,6 +6,7 @@ position: absolute; transform: translate(-50%, -50%); z-index: 1000; + border-radius: $border-radius-base; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); padding: 10px; diff --git a/_vendor/modules.txt b/_vendor/modules.txt index 572a9970bd..0e39dba148 100644 --- a/_vendor/modules.txt +++ b/_vendor/modules.txt @@ -14,7 +14,7 @@ # github.com/chef/compliance-profiles/docs-chef-io v0.0.0-20241106111500-6a8759e49b64 # github.com/chef/compliance-remediation-2022/docs-chef-io v0.0.0-20240313054833-ebbc45209efa # github.com/chef/license-service/docs-chef-io v0.0.0-20231117105514-d3f3d53ba2dd -# github.com/chef/chef-docs-theme v0.0.0-20241119200251-e9924c9d1278 +# github.com/chef/chef-docs-theme v0.0.0-20241206202643-d5ef90c514a1 # github.com/FortAwesome/Font-Awesome v0.0.0-20240108205627-a1232e345536 # github.com/cowboy/jquery-hashchange v0.0.0-20100902193700-0310f3847f90 # github.com/twitter/hogan.js v3.0.2+incompatible diff --git a/go.mod b/go.mod index b535904066..5f7286e868 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.22 require ( github.com/chef/automate/components/docs-chef-io v0.0.0-20241202053455-d6fa3db8941a // indirect - github.com/chef/chef-docs-theme v0.0.0-20241119200251-e9924c9d1278 // indirect + github.com/chef/chef-docs-theme v0.0.0-20241206202643-d5ef90c514a1 // indirect github.com/chef/chef-server/docs-chef-io v0.0.0-20241126093050-948ceb81afae // indirect github.com/chef/chef-workstation/docs-chef-io v0.0.0-20240809064339-878cb76b2b66 // indirect github.com/chef/compliance-profiles/docs-chef-io v0.0.0-20241106111500-6a8759e49b64 // indirect diff --git a/go.sum b/go.sum index 28994e5485..4644dd56b4 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,7 @@ github.com/chef/automate/components/docs-chef-io v0.0.0-20241202053455-d6fa3db8941a h1:EzM6PeCHWg2y1XcXr4axYo/tXmfaYHWjTBX6cAiCaJI= github.com/chef/automate/components/docs-chef-io v0.0.0-20241202053455-d6fa3db8941a/go.mod h1:juvLC7Rt33YOCgJ5nnfl4rWZRAbSwqjTbWmcAoA0LtU= -github.com/chef/chef-docs-theme v0.0.0-20241119200251-e9924c9d1278 h1:m8AMAMs3n5s709tRYnDzNcx8jCqxzCwDUSfftaVbs7g= -github.com/chef/chef-docs-theme v0.0.0-20241119200251-e9924c9d1278/go.mod h1:+Jpnv+LXE6dXu2xDcMzMc0RxRGuCPAoFxq5tJ/X6QpQ= +github.com/chef/chef-docs-theme v0.0.0-20241206202643-d5ef90c514a1 h1:1ASUjeDFUBsmMX6mMlqxYN4mGtsS4lJ7AkyYiw3FOd4= +github.com/chef/chef-docs-theme v0.0.0-20241206202643-d5ef90c514a1/go.mod h1:+Jpnv+LXE6dXu2xDcMzMc0RxRGuCPAoFxq5tJ/X6QpQ= github.com/chef/chef-server/docs-chef-io v0.0.0-20241126093050-948ceb81afae h1:ml5zs10Wv+YgJSq5zLlyLroTcP2x1U4Op/whIpVr14s= github.com/chef/chef-server/docs-chef-io v0.0.0-20241126093050-948ceb81afae/go.mod h1:gMSa25GUHmLimA0gjvRd3hs1buOBqkKPrdHzHvaJauY= github.com/chef/chef-workstation/docs-chef-io v0.0.0-20240809064339-878cb76b2b66 h1:mGSa2uVyyi8bHyluwmmd83UReZR9gqF/roi5v7lnv0s=