texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * js/info.js: Add tooltips for show/hide sidebar


From: Per Bothner
Subject: branch master updated: * js/info.js: Add tooltips for show/hide sidebar button.
Date: Mon, 22 Mar 2021 10:29:58 -0400

This is an automated email from the git hooks/post-receive script.

bothner pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new 0330af2  * js/info.js: Add tooltips for show/hide sidebar button.
0330af2 is described below

commit 0330af29e294f4417342b340088967a190855dfc
Author: Per Bothner <per@bothner.com>
AuthorDate: Mon Mar 22 07:29:28 2021 -0700

    * js/info.js: Add tooltips for show/hide sidebar button.
    
    (SHOW_SIDEBAR_TOOLTIP, HIDE_SIDEBAR_TOOLTIP): Tooltip text.
    (show_sidebar): Update tooltips on show/hide of sidebar.
---
 ChangeLog  | 4 ++++
 js/info.js | 7 +++++++
 2 files changed, 11 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 96bb7bd..6b66dbd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2021-03-22  Per Bothner  <per@bothner.com>
 
+       * js/info.js: Add tooltips for show/hide sidebar button.
+       (SHOW_SIDEBAR_TOOLTIP, HIDE_SIDEBAR_TOOLTIP): Tooltip text.
+       (show_sidebar): Update tooltips on show/hide of sidebar.
+
        * js/info.js (maybe_pageref_url_p): Recognize "index.html#PAGE".
 
 2021-03-20  Gavin Smith  <gavinsmith0123@gmail.com>
diff --git a/js/info.js b/js/info.js
index 9326bef..05a92c9 100644
--- a/js/info.js
+++ b/js/info.js
@@ -36,6 +36,8 @@
     LOCAL_HTML_PAGE_PATTERN: ".*[.](html|htm|xhtml)$",
     SHOW_SIDEBAR_HTML: "<span>Show sidebar</span>",
     HIDE_SIDEBAR_HTML: "<span>Hide sidebar</span>",
+    SHOW_SIDEBAR_TOOLTIP: 'Show navigation sidebar',
+    HIDE_SIDEBAR_TOOLTIP: 'Hide navigation sidebar',
 
     // hooks:
     /** Define a function called after 'DOMContentLoaded' event in
@@ -1441,6 +1443,11 @@
   {
     document.body.setAttribute("show-sidebar", show ? "yes" : "no");
     show_sidebar_button.innerHTML = show ? config.HIDE_SIDEBAR_HTML : 
config.SHOW_SIDEBAR_HTML;
+    var tooltip = show ? config.HIDE_SIDEBAR_TOOLTIP : 
config.SHOW_SIDEBAR_TOOLTIP;
+    if (tooltip)
+      show_sidebar_button.setAttribute("title", tooltip);
+    else
+      show_sidebar_button.removeAttribute("title");
   }
 
   /** Handle unload events.  */



reply via email to

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