]> _ Git - fluidbook-html5.git/commitdiff
fix #1446 @0.75
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 8 Jun 2017 14:09:45 +0000 (16:09 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 8 Jun 2017 14:09:45 +0000 (16:09 +0200)
js/libs/fluidbook/fluidbook.js
style/fluidbook.less

index 4b75547e60f896f6e7bcfd7a898da56f8699073c..5baf47d44e59cb55949bfe9cd85a4c36f3f74f79 100644 (file)
@@ -20,6 +20,7 @@ Fluidbook.RIGHT = 6;
 Fluidbook.MIDDLE = 7;
 Fluidbook.TOP = 8;
 Fluidbook.BOTTOM = 9;
+
 Fluidbook.prototype = {
     init: function (datas) {
         this.datas = datas;
@@ -129,7 +130,7 @@ Fluidbook.prototype = {
     },
     _hideSplash: function () {
         this.ready();
-        $("#main").css('visibility', 'visible');
+        $("#main,#viewOverlay,#view").css('visibility', 'visible');
         this.hideLoader(0, true);
 
         if (this.support.transitions2d) {
@@ -285,7 +286,7 @@ Fluidbook.prototype = {
         var $this = this;
         var page;
         var args = window.location.hash.split('/');
-        
+
         if (args.length <= 1 || args[1] == '' || args[1] == undefined) {
             return this.setCurrentPage('1');
         } else if (args[1] == 'closeview') {
@@ -318,7 +319,27 @@ Fluidbook.prototype = {
             }, true);
         }
         else {
-            this.menu.openView(args[1], args[2], args[3], function () {
+            var view = args[1];
+            if (this.currentPage == -1) {
+                if (view == 'multimedia' || view == 'video') {
+                    var $this = this;
+                    var searchURL = args.join('/');
+                    $.each(this.datas.links, function (pageNr, links) {
+                        var hl = $('<root>' + links + '</root>');
+                        if ($(hl).find('[href="' + searchURL + '"]').length > 0) {
+                            $this.currentPage = pageNr;
+                            return false;
+                        }
+                    });
+                    if (this.currentPage == -1) {
+                        this.currentPage = 0;
+                    }
+                } else {
+                    this.currentPage = 0;
+                }
+                $this.pageTransition(this.currentPage);
+            }
+            this.menu.openView(view, args[2], args[3], function () {
                 $this.hideSplash();
             });
             this.zoom.resetZoom();
index 107bbd2f9557d1b215b644ce637bbb74c7cd04f3..6dc6900f25d2bb49cbb0fe8691f0764acf567540 100644 (file)
@@ -837,6 +837,10 @@ footer.hidden, header.hidden, #interface.hidden {
        .overlayBackground();
 }
 
+#view, #viewOverlay {
+       visibility: hidden;
+}
+
 .mview {
        background-color: @menu-background;
        color: @menu-text;