]> _ Git - fluidbook-html5.git/commitdiff
(no commit message)
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 26 Aug 2013 16:38:04 +0000 (16:38 +0000)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 26 Aug 2013 16:38:04 +0000 (16:38 +0000)
js/libs/fluidbook/fluidbook.js
js/libs/fluidbook/fluidbook.resize.js
js/libs/fluidbook/fluidbook.support.js

index fa709b5a0981ed543b048caa83b96faadcfd3b04..8eb02dfb456cd5a2c4b406ddbbe63c4ec3d6d660 100644 (file)
@@ -102,6 +102,7 @@ Fluidbook.prototype = {
                $("#main").css('visibility', 'visible');\r
                this.hideLoader(0, true);\r
                $("#splash").css('opacity', 0).one(this.support.getTransitionEndEvent(), function() {\r
+                       fb('removed splash');\r
                        $(this).remove();\r
                });\r
        },\r
@@ -833,6 +834,8 @@ Fluidbook.prototype = {
                                                pagesWithHits++;\r
                                        }\r
                                }\r
+                               \r
+                               if($(this))\r
 \r
                                if ($(this).find('.hits').length > 0) {\r
                                        return;\r
@@ -847,7 +850,7 @@ Fluidbook.prototype = {
                                        $(this).append('<div class="hits no">' + $this.l10n.__('no result found') + '</div>');\r
                                } else {\r
                                        $(this).append('<div class="hits yes">' + hitsp + ' ' + $this.l10n.__('hit(s)') + '</div>');\r
-                                       if (pagesWithHits <= 1) {\r
+                                       if (pagesWithHits <= 2) {\r
                                                $(this).find('a').attr('href', '#/page/' + $(this).attr('page'));\r
                                        } else {\r
                                                $(this).find('a').attr('href', '#/search/' + e + '/' + $(this).attr('page'));\r
index 6bf23440d6521f5de2e57fd72d80cf8e81e45157..f6c9ddd97f4bac797440bcf9e088bab688d9e3d1 100644 (file)
@@ -42,6 +42,8 @@ FluidbookResize.prototype = {
                        init = false;\r
                }\r
 \r
+               $("#main").hide();\r
+\r
                var $this = this;\r
                this.updateWindow();\r
                this.handleOrientation();\r
@@ -56,7 +58,6 @@ FluidbookResize.prototype = {
                var cssInterfaceScale = [interfaceScale, interfaceScale];\r
                var cssNavScale = [navScale, navScale];\r
 \r
-\r
                $("#main").css({\r
                        width: this.ww,\r
                        height: this.hh\r
@@ -108,18 +109,26 @@ FluidbookResize.prototype = {
                        scale: [this.bookScale, this.bookScale],\r
                        origin: ['50%', '50%']\r
                });\r
+               var top = marginTop + (ah - fhh) / 2;\r
+               var left = marginLeft + (aw - fww) / 2;\r
                $("#fluidbook").css({\r
-                       top: marginTop + (ah - fhh) / 2,\r
-                       left: marginLeft + (aw - fww) / 2,\r
+                       top: top,\r
+                       left: left,\r
                        width: fww,\r
                        height: fhh\r
                });\r
 \r
 \r
-               $("#next,#previous").transform({\r
-                       scale: cssInterfaceScale\r
+               $("#next").transform({\r
+                       scale: cssInterfaceScale,\r
+                       translateX: 40 * (1 - interfaceScale) + 'px'\r
                });\r
 \r
+               $("#previous").transform({\r
+                       scale: cssInterfaceScale,\r
+                       translateX: -40 * (1 - interfaceScale) + 'px'\r
+               })\r
+\r
                $("#nav,#logo,footer").transform({\r
                        scale: navScale\r
                });\r
@@ -154,8 +163,12 @@ FluidbookResize.prototype = {
                        this.resizeNav(interfaceScale);\r
                }\r
 \r
+\r
+\r
                this.resizePopupVideos();\r
                this.resizeSplash();\r
+\r
+               $("#main").show();\r
        },\r
        resizeNav: function(interfaceScale) {\r
                var topNext = (this.hh - 100 * interfaceScale) / 2;\r
@@ -178,6 +191,9 @@ FluidbookResize.prototype = {
                });\r
        },\r
        resizeSplash: function() {\r
+               if ($("#splash").length == 0) {\r
+                       return;\r
+               }\r
                $("#splash").css({\r
                        width: this.ww,\r
                        height: this.hh\r
@@ -252,8 +268,8 @@ FluidbookResize.prototype = {
                        newo = 'landscape';\r
                        $('body').removeClass('portrait');\r
                }\r
-\r
-               if (this.orientation == newo) {\r
+               var force = this.fluidbook.datas.mobileNavigationType != 'book';\r
+               if (!force && this.orientation == newo) {\r
                        return;\r
                }\r
                this.orientation = newo;\r
index de7ed49fbd9ba6dd8d759a55410ae8cb2c655483..d5b923645cc1ed0a0b261fec42070477c57722d7 100644 (file)
@@ -76,6 +76,8 @@ FluidbookSupport.prototype = {
                return t;
        },
        initEvents: function() {
+               
+               var $this=this;
 
                if (!this.isMobile) {
                        $(window).resize(function() {
@@ -86,7 +88,7 @@ FluidbookSupport.prototype = {
 
                if ("onorientationchange" in window) {
                        window.addEventListener('orientationchange', function() {
-                               if (this.iOS) {
+                               if ($this.iOS) {
                                        resize();
                                } else {
                                        resize();
@@ -96,7 +98,6 @@ FluidbookSupport.prototype = {
                                }
                        }, false);
                } else {
-                       var $this = this;
                        setInterval(function() {
                                $this.checkOrientation();
                        }, 100);
@@ -114,26 +115,21 @@ FluidbookSupport.prototype = {
                try {
                        if (this.fluidbook.pad && this.fluidbook.pad.enabled) {
                                return 0;
+                       }else if(this.fluidbook.datas.mobileNavigationType=='landscape'){
+                               return 90;
+                       }else if(this.fluidbook.datas.mobileNavigationType=='portrait'){
+                               return 0;
                        }
                } catch (err) {
 
                }
 
                try {
-                       var mql = Modernizr.mq("(orientation: portrait)");
-                       if (mql.matches) {
-                               return 0;
-                       } else {
-                               return 90;
-                       }
+                       return Modernizr.mq("(orientation: portrait)") ? 0 : 90;
                } catch (err) {
 
                }
-               if ($("#op").is(':visible')) {
-                       return 0;
-               } else {
-                       return 90;
-               }
+               return $("#op").is(':visible') ? 0 : 90;
        },
        getZoomLevel: function() {
                var tzoom = DetectZoom.zoom();