]> _ Git - fluidbook-html5.git/commitdiff
wip #2183 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 17 Aug 2018 10:18:05 +0000 (12:18 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 17 Aug 2018 10:18:05 +0000 (12:18 +0200)
js/libs/fluidbook/fluidbook.js
js/libs/fluidbook/fluidbook.menu.js

index b744a6e40a4a303b4101d379f439e46fbfab9dfe..1725c316af2334fb7dc4a13ddb58ec6642a0bcf6 100644 (file)
@@ -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);
index e05d1123161b48b25ac02e1ee8d7236ad55374ae..1118a6142650f2ca9427f213084ea0777a91c767 100644 (file)
@@ -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) {