From e258a8dd82dfa6733bbfe2fdb76896dbc9acf348 Mon Sep 17 00:00:00 2001 From: Andrey Kuvshinov Date: Wed, 8 Apr 2020 20:47:07 +0300 Subject: [PATCH] add dynamic href --- app/modules/anpdf/anpdf2.phtml | 8 +++++--- app/pub/scripts/anviewer.js | 6 ++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/app/modules/anpdf/anpdf2.phtml b/app/modules/anpdf/anpdf2.phtml index 649aa2b..f83777d 100644 --- a/app/modules/anpdf/anpdf2.phtml +++ b/app/modules/anpdf/anpdf2.phtml @@ -12,7 +12,9 @@ scale = , url = '', pageRendering = false, - pageNumPending = null; + pageNumPending = null, + nexturl = '', + prevurl = ''; @@ -104,11 +106,11 @@ _tmr.push({id: "1069168", type: "pageView", start: (new Date()).getTime()});
diff --git a/app/pub/scripts/anviewer.js b/app/pub/scripts/anviewer.js index 2d3f276..5b620bd 100644 --- a/app/pub/scripts/anviewer.js +++ b/app/pub/scripts/anviewer.js @@ -35,6 +35,12 @@ function renderPage() { document.getElementById('zoompdf').innerHTML = scale + 'x'; document.getElementById('pdfprogress').innerHTML = 'Приятного чтения ↓'; + + if (typeof prevlink !== 'undefined') + document.getElementById('prevbutton').setAttribute("href", prevlink + '/'+ scale); + + if (typeof nextlink !== 'undefined') + document.getElementById('nextbutton').setAttribute("href", nextlink + '/'+ scale); }