},
openPDF: function (uid, callback) {
+ let $this=this;
var infos = this.fluidbook.settings.pdfLinks[uid];
let c = this.getCaption('', 'nocaption', 'nocaption');
c += '<div class="content"><div class="pdf-holder"><iframe class="pdf view ' + infos.interface + '" data-width="' + infos.width + '" data-height="' + infos.height + '" data-total-height="' + infos.totalHeight + '" frameborder="0" scrolling="no" src="pdfjs/web/viewer.html?&file=../../data/links/' + infos.file + '#zoom=page-width"></iframe></div></div>';
if (callback != undefined) {
callback();
}
+
+ $('iframe.pdf.view').each(function () {
+ relayIframeScrollToView($(this));
+ });
+
+
this.fluidbook.displayLoader();
},
}
}
+function relayIframeScrollToView(iframe) {
+ var view = iframe.parent().parent();
+ console.log(view, this);
+ $(this).on('load', function () {
+ var body = $(this).contents().find('body');
+ var m = 25;
+ $(body).on('mousewheel', function (e) {
+ var d = (e.deltaY * m);
+ var v = '-=' + d;
+ if (e.deltaY < 0) {
+ v = '+=' + (d * -1);
+ }
+ $(view).scrollTo(v);
+ });
+ });
+}