mirror of
https://github.com/pdf2htmlEX/pdf2htmlEX.git
synced 2024-12-21 12:40:08 +00:00
Merge pull request #96 from gtryf/in-doc-links
Fix in-document links (supersedes #95)
This commit is contained in:
commit
7c9086b958
@ -329,7 +329,7 @@ Viewer.prototype = {
|
||||
}, false);
|
||||
|
||||
// handle links
|
||||
[this.container, this.outline].forEach(function(ele) {
|
||||
[this.outline].concat(Array.from(this.container.querySelectorAll('a.l'))).forEach(function(ele) {
|
||||
ele.addEventListener('click', self.link_handler.bind(self), false);
|
||||
});
|
||||
|
||||
@ -804,6 +804,10 @@ Viewer.prototype = {
|
||||
link_handler : function (e) {
|
||||
var target = /** @type{Node} */(e.target);
|
||||
var detail_str = /** @type{string} */ (target.getAttribute('data-dest-detail'));
|
||||
if (!detail_str) {
|
||||
target = /** @type{Node} */(e.currentTarget);
|
||||
detail_str = /** @type{string} */ (target.getAttribute('data-dest-detail'));
|
||||
}
|
||||
if (!detail_str) return;
|
||||
|
||||
if (this.config['view_history_handler']) {
|
||||
|
Loading…
Reference in New Issue
Block a user