// Note: iOS won't catch click events unless the element has a cursor:pointer style
// This was added for #viewOverlay in the CSS
// More details: https://stackoverflow.com/a/16006333
- $(document).on(this.fluidbook.input.clickEvent, ".mview .button.back, #viewOverlay", function (e) {
+ $(document).on(this.fluidbook.input.clickEvent, ".mview .button.back", function (e) {
+ return handleCloseView(e, true);
+ });
+
+ $(document).on(this.fluidbook.input.clickEvent, "#viewOverlay", function (e) {
+ // Don't close if a interactive multimedia popup is currently displayed
+ let close = $(".mview[data-menu=multimedia] .multimediaScale .multimedia:not(.notinteractive)").length === 0;
+ return handleCloseView(e, close);
+ });
+
+ function handleCloseView(e, closeView) {
e.stopImmediatePropagation();
e.stopPropagation();
e.preventDefault();
- $this.closeView(function () {
- }, false);
+ if (closeView) {
+ $this.closeView(function () {
+ }, false);
+ }
return false;
- });
+ }
if (this.fluidbook.settings.displayChaptersAtStart) {
$(this.fluidbook).on('fluidbook.splash.hide', function () {
},
openPDF: function (uid, callback) {
- let $this=this;
+ 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>';