[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Gavin D. Smith |
Date: |
Wed, 30 Nov 2022 09:21:13 -0500 (EST) |
branch: release/7.0
commit aefe4b2f8def2b20d46aebd6fc42eb6040245fa1
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Wed Nov 30 13:31:54 2022 +0000
Fix info.js for release branch.
* js/info.js (cache_index_links),
(init_iframe) <on_load>:
Change how 'printindex-index-entry' and 'printindex-index-section'
links are found to match structure of HTML in index, which
has been changed on the master branch.
---
ChangeLog | 10 ++++++++++
js/info.js | 4 ++--
.../formatting_epub_package/EPUB/js/info.js | 6 +++---
3 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 1f65c104b3..ff2a0f8ce5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2022-11-30 Gavin Smith <gavinsmith0123@gmail.com>
+
+ Fix info.js for release branch.
+
+ * js/info.js (cache_index_links),
+ (init_iframe) <on_load>:
+ Change how 'printindex-index-entry' and 'printindex-index-section'
+ links are found to match structure of HTML in index, which
+ has been changed on the master branch.
+
2022-11-27 Per Bothner <per@bothner.com>
* js/info.js (set_current)url): Don't set parameter default.
diff --git a/js/info.js b/js/info.js
index c99d2cf147..7e33ff0115 100644
--- a/js/info.js
+++ b/js/info.js
@@ -166,7 +166,7 @@
text0 = text;
}
- if ((link = link.nextSibling)
+ if ((link = link.parentElement.parentElement.lastChild)
&& link.classList.contains("printindex-index-section")
&& (link = link.firstChild))
{
@@ -1480,7 +1480,7 @@
{
/* Scan links that should be added to the index. */
var index_entries = document.querySelectorAll
- ("td.printindex-index-entry");
+ ("td.printindex-index-entry a");
store.dispatch (actions.cache_index_links (index_entries));
}
diff --git
a/tp/tests/layout/res_parser/formatting_epub_nodes/formatting_epub_package/EPUB/js/info.js
b/tp/tests/layout/res_parser/formatting_epub_nodes/formatting_epub_package/EPUB/js/info.js
index 97c6ce3839..7e33ff0115 100644
---
a/tp/tests/layout/res_parser/formatting_epub_nodes/formatting_epub_package/EPUB/js/info.js
+++
b/tp/tests/layout/res_parser/formatting_epub_nodes/formatting_epub_package/EPUB/js/info.js
@@ -120,7 +120,7 @@
@arg {string} linkid - link identifier
@arg {string|false} [history] - method name that will be applied on
the 'window.history' object. */
- set_current_url: function (linkid, history, clicked = false) {
+ set_current_url: function (linkid, history, clicked) {
if (undef_or_null (history))
history = "pushState";
return { type: "current-url", url: linkid,
@@ -166,7 +166,7 @@
text0 = text;
}
- if ((link = link.nextSibling)
+ if ((link = link.parentElement.parentElement.lastChild)
&& link.classList.contains("printindex-index-section")
&& (link = link.firstChild))
{
@@ -1480,7 +1480,7 @@
{
/* Scan links that should be added to the index. */
var index_entries = document.querySelectorAll
- ("td.printindex-index-entry");
+ ("td.printindex-index-entry a");
store.dispatch (actions.cache_index_links (index_entries));
}