Fix in-document links
This commit is contained in:
parent
e902d82c3c
commit
200083d154
|
@ -329,7 +329,7 @@ Viewer.prototype = {
|
||||||
}, false);
|
}, false);
|
||||||
|
|
||||||
// handle links
|
// 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);
|
ele.addEventListener('click', self.link_handler.bind(self), false);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -804,6 +804,10 @@ Viewer.prototype = {
|
||||||
link_handler : function (e) {
|
link_handler : function (e) {
|
||||||
var target = /** @type{Node} */(e.target);
|
var target = /** @type{Node} */(e.target);
|
||||||
var detail_str = /** @type{string} */ (target.getAttribute('data-dest-detail'));
|
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 (!detail_str) return;
|
||||||
|
|
||||||
if (this.config['view_history_handler']) {
|
if (this.config['view_history_handler']) {
|
||||||
|
|
Loading…
Reference in New Issue