From 211dd7445e3a9ae511e9fc39bfd29649a53d3cd5 Mon Sep 17 00:00:00 2001 From: Kang Cheng Date: Tue, 30 Oct 2018 23:30:55 +0000 Subject: [PATCH] Add hideOtherSidebarContent option Allow user to configure whether or not to hide other sidebar content while showing searching results. Related issue: https://github.com/docsifyjs/docsify/issues/535 --- docs/plugins.md | 4 +++- src/core/render/tpl.js | 2 +- src/plugins/search/component.js | 26 ++++++++++++++++++++++++-- src/plugins/search/index.js | 4 +++- 4 files changed, 31 insertions(+), 5 deletions(-) diff --git a/docs/plugins.md b/docs/plugins.md index 2d1bcc672..ae4e46647 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -37,7 +37,9 @@ By default, the hyperlink on the current page is recognized and the content is s }, // Headline depth, 1 - 6 - depth: 2 + depth: 2, + + hideOtherSidebarContent: false, // whether or not to hide other sidebar content } } diff --git a/src/core/render/tpl.js b/src/core/render/tpl.js index c1bfd4f9b..71f565238 100644 --- a/src/core/render/tpl.js +++ b/src/core/render/tpl.js @@ -36,7 +36,7 @@ export function main(config) { '' + '