-
-
-function rescalePdf(viewer, frameWidth) {
+function rescalePdf(viewer) {
var scaleBase = 750;
var outlineWidth = 250;
+ var frameWidth = parseInt($('#tabs-content')[0].clientWidth);
var pdfWidth = frameWidth;
if ($(viewer.sidebar).hasClass('opened')){
viewer.rescale(newPdfScale);
}
-function setupPdfViewer(noteframe) {
- var pdfViewer = noteframe.pdf2htmlEX.defaultViewer;
+function setupPdfViewer(noteframe, pdfViewer) {
$('#plus-btn').click(function (){
pdfViewer.rescale(1.20, true, [0,0]);
$('#outline-btn').click(function() {
$(pdfViewer.sidebar).toggleClass('opened');
// rescale the PDF to fit the available space
- rescalePdf(pdfViewer, parseInt(noteframe.frameElement.clientWidth));
+ rescalePdf(pdfViewer);
});
$('#scroll-to').change(function() {
});
// rescale the PDF to fit the available space
- rescalePdf(pdfViewer, parseInt(noteframe.frameElement.clientWidth));
+ rescalePdf(pdfViewer);
}
function writeNoteFrame(contents) {
} \
}); })";
injectScript(js, noteframe);
+
if (pdfControls == true) {
+ var pdfViewer = noteframe.pdf2htmlEX.defaultViewer;
$(noteframe.document).ready(function() {
- setupPdfViewer(noteframe);
+ setupPdfViewer(noteframe, pdfViewer);
});
}
});