texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]


From: Gavin D. Smith
Date: Wed, 30 Nov 2022 13:36:44 -0500 (EST)

branch: old/qt-info
commit ba80a3cbcf24ef38c606ae205f226c9cf7af1e58
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Sat Apr 20 18:24:56 2019 +0100

    Scroll to start of sidebar correctly.
    
    * js/info.js (add_header, scan_toc):
    Use "sidebar_start" as the ID of an element added at the start
    of the table of contents, instead of "index".  "index" is the ID
    of the <div> containing the Top node.  The Top node would be
    scrolled right to the start some time after the page had
    displayed, even if the user had already scrolled down in it.
---
 ChangeLog  | 11 +++++++++++
 js/info.js |  4 ++--
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 925d6eaed6..79cbbf8d56 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2019-04-20  Gavin Smith  <gavinsmith0123@gmail.com>
+
+       Scroll to start of sidebar correctly.
+
+       * js/info.js (add_header, scan_toc):
+       Use "sidebar_start" as the ID of an element added at the start 
+       of the table of contents, instead of "index".  "index" is the ID 
+       of the <div> containing the Top node.  The Top node would be 
+       scrolled right to the start some time after the page had 
+       displayed, even if the user had already scrolled down in it.
+
 2019-04-20  Gavin Smith  <gavinsmith0123@gmail.com>
 
        Make help optional.
diff --git a/js/info.js b/js/info.js
index 1aacb96028..efd3eb2e23 100644
--- a/js/info.js
+++ b/js/info.js
@@ -1228,7 +1228,7 @@ var user_config = window["INFO_CONFIG"];
       if (url === config.TOP_ID)
         {
           hide_grand_child_nodes (ul);
-          res = document.getElementById(url);
+          res = document.getElementById('sidebar_start');
         }
       else
         {
@@ -1287,7 +1287,7 @@ var user_config = window["INFO_CONFIG"];
           var header = document.createElement ("header");
           var a = document.createElement ("a");
           a.setAttribute ("href", config.TOP_NAME);
-          a.setAttribute ("id", config.TOP_ID);
+          a.setAttribute ("id", "sidebar_start");
           header.appendChild (a);
           var div = document.createElement ("div");
           a.appendChild (div);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]