From d0695c225a7adbca357d25bae0960e63bb9741b4 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Fri, 17 Aug 2018 12:18:05 +0200 Subject: [PATCH] wip #2183 @1 --- js/libs/fluidbook/fluidbook.js | 2 +- js/libs/fluidbook/fluidbook.menu.js | 21 ++++++++++++++------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/js/libs/fluidbook/fluidbook.js b/js/libs/fluidbook/fluidbook.js index b744a6e4..1725c316 100644 --- a/js/libs/fluidbook/fluidbook.js +++ b/js/libs/fluidbook/fluidbook.js @@ -377,7 +377,7 @@ Fluidbook.prototype = { if (this.landingpage !== undefined) { this.landingpage.hide(); } - this.menu.closeView(function () { + this.menu._closeView(function () { if (page != $this.currentPage) { $this.pageTransition(page); $this.stats.track(0, page); diff --git a/js/libs/fluidbook/fluidbook.menu.js b/js/libs/fluidbook/fluidbook.menu.js index e05d1123..1118a614 100644 --- a/js/libs/fluidbook/fluidbook.menu.js +++ b/js/libs/fluidbook/fluidbook.menu.js @@ -12,13 +12,7 @@ FluidbookMenu.prototype = { // This was added for #viewOverlay in the CSS // More details: https://stackoverflow.com/a/16006333 $(document).on('click', ".mview .back, #viewOverlay", function () { - var currentHash = window.location.hash; - window.location.hash = '/page/' + $this.fluidbook.currentPage; - if (window.location.hash == currentHash) { - $this.closeView(function () { - }, true); - } - + $this.closeView(function(){},true); return false; }); @@ -448,7 +442,20 @@ FluidbookMenu.prototype = { callback(); } }, + closeView: function (callback, all, animate) { + if (callback === undefined) { + callback = function () { + }; + } + + var currentHash = window.location.hash; + window.location.hash = '/page/' + $this.fluidbook.currentPage; + if (window.location.hash == currentHash) { + this._closeView(callback, all, animate); + } + }, + _closeView: function (callback, all, animate) { this.hideOverlay(); var $this = this; if (all == undefined) { -- 2.39.5