From 1a75920e9c350e470c10ea3eab1726fe5487934c Mon Sep 17 00:00:00 2001 From: Francis Lavoie Date: Thu, 24 Sep 2020 20:49:56 -0400 Subject: [PATCH] docs: Minor JSON docs bugfix for hiding a header, remove invalid comment --- src/includes/docs-details.html | 2 +- src/resources/js/docs-api.js | 4 ++-- src/resources/js/docs.js | 5 ++--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/includes/docs-details.html b/src/includes/docs-details.html index 4125c81..5148da2 100644 --- a/src/includes/docs-details.html +++ b/src/includes/docs-details.html @@ -10,7 +10,7 @@
-

Field List

+

Field List

\ No newline at end of file diff --git a/src/resources/js/docs-api.js b/src/resources/js/docs-api.js index 1978261..12917cd 100644 --- a/src/resources/js/docs-api.js +++ b/src/resources/js/docs-api.js @@ -179,8 +179,8 @@ function beginRendering(json) { renderData(pageData.structure, 0, "", $('
')); console.log("DOCS:", pageDocs); - if ($('#field-list-contents').html().trim()) { - $('#field-list').show(); + if ($('#field-list-contents').text().trim()) { + $('#field-list-header').show(); } // if the browser tried to navigate directly to an element diff --git a/src/resources/js/docs.js b/src/resources/js/docs.js index 101ddbc..d0a7b8c 100644 --- a/src/resources/js/docs.js +++ b/src/resources/js/docs.js @@ -50,9 +50,8 @@ $(function() { }); // Add links to [] or named matcher tokens in code blocks. - // We can't do it exactly the same as the above block, because - // the matcher text includes <> character which are parsed as HTML - // unless we use text() to change the link text. + // The matcher text includes <> characters which are parsed as HTML, + // so we must use text() to change the link text. $('pre.chroma .nd') .map(function(k, item) { let text = item.innerText;