[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:41 -0500 (EST) |
branch: old/qt-info
commit 11892d2b455579440cf0d7ed499f5cd6e28acd30
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Sat Apr 13 13:20:09 2019 +0100
scroll to search result in top node
---
js/info.js | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/js/info.js b/js/info.js
index 640708157f..44b9a8fa1a 100644
--- a/js/info.js
+++ b/js/info.js
@@ -1106,6 +1106,17 @@ var user_config = window["INFO_CONFIG"];
/* Follow up actions to the store. */
store.dispatch (data.action);
}
+ else if (data.message_kind === "scroll-to")
+ {
+ /* Used for text search. Scroll to the anchor corresponding to
+ HASH. */
+ var anchor = data.hash.substr(1); /* Remove the #. */
+ document.getElementById(anchor).scrollIntoView ();
+
+ /* 'location.replace (data.hash);' triggers a DOMContentLoaded event
+ which has bad results for the top page. */
+
+ }
}
/* Event handler for 'popstate' events. */
- [no subject], (continued)
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject],
Gavin D. Smith <=
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30
- [no subject], Gavin D. Smith, 2022/11/30