diff --git a/TODO b/TODO index 5088cb4..3423e98 100644 --- a/TODO +++ b/TODO @@ -1,5 +1,3 @@ -link handling + scale - more information on demo page: - showing pdf2htmlEX home page - link to other demos diff --git a/share/pdf2htmlEX.js.in b/share/pdf2htmlEX.js.in index ad41a26..15aee3c 100644 --- a/share/pdf2htmlEX.js.in +++ b/share/pdf2htmlEX.js.in @@ -648,7 +648,7 @@ }, link_handler : function (e) { - var target = e.currentTarget; + var target = e.target; var cur_pos = [0,0]; @@ -710,13 +710,16 @@ } if(ok) { + var _ = this; + var scale = this.scale; + var _pos = [pos[0] * scale, pos[1] * scale] /* page should of type Page */ var transform_and_scroll = function(page) { - pos = transform(page.ctm, pos); + _pos = transform(page.ctm, _pos); if(upside_down) { - pos[1] = page.height() - pos[1]; + _pos[1] = page.height() - _pos[1]; } - this.scroll_to(target_page_idx, pos); + _.scroll_to(target_page_idx, _pos); }; if (target_page.loaded) {