]> _ Git - fluidbook-html5.git/commitdiff
(no commit message)
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 16 Aug 2013 15:25:32 +0000 (15:25 +0000)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 16 Aug 2013 15:25:32 +0000 (15:25 +0000)
js/libs/fluidbook/fluidbook.help.js
js/libs/fluidbook/fluidbook.pad.js
js/libs/fluidbook/fluidbook.touch.js
js/main.js

index 07c2cc38898607160be58d2a05bd523d75ddee4a..f7f852bfd9da8532de0b0d62878abb7ed224b9bc 100644 (file)
@@ -101,18 +101,21 @@ FluidbookHelp.prototype = {
                        });\r
                } else {\r
                        $("#help").click(function() {\r
-                               $this.toggle();\r
+                               $this.show();\r
                                return false;\r
                        });\r
                }\r
        },\r
+       isVisible: function() {\r
+               return this.view.is(":visible");\r
+       },\r
        show: function(time) {\r
                this.clearTimeout();\r
                if (time == undefined) {\r
                        time = 0;\r
                }\r
 \r
-               if (this.view.is(":visible")) {\r
+               if (this.isVisible()) {\r
                        return false;\r
                }\r
 \r
@@ -125,8 +128,13 @@ FluidbookHelp.prototype = {
                this.view.show();\r
                this.fluidbook.showAllButtons();\r
                if (this.fluidbook.support.isMobile) {\r
-                       $(document).one('click touchend', function() {\r
+                       $(document).one('click t', function(e) {\r
+                               e.stopImmediatePropagation();\r
+                               e.stopPropagation();\r
+                               e.preventDefault();\r
+\r
                                $this.hide();\r
+                               return false;\r
                        });\r
                } else {\r
                        if (time != 0) {\r
@@ -140,7 +148,7 @@ FluidbookHelp.prototype = {
        hide: function() {\r
                this.clearTimeout();\r
                var $this = this;\r
-               if (this.view.is(':visible')) {\r
+               if (this.isVisible()) {\r
                        this.view.hide();\r
                        this.fluidbook.hideUnnecessaryButtons();\r
                        if (this.fluidbook.support.isMobile) {\r
@@ -152,7 +160,7 @@ FluidbookHelp.prototype = {
                return false;\r
        },\r
        toggle: function() {\r
-               if (this.view.is(':visible')) {\r
+               if (this.isVisible()) {\r
                        this.hide();\r
                } else {\r
                        this.show();\r
index ac134ba07972478ce8bfdbd3b68ef225b31aef96..0474704f44c91bb4da70b9b197972f286dc24092 100644 (file)
@@ -18,6 +18,9 @@ FluidbookPad.prototype = {
        initEvents: function() {\r
                var $this = this;\r
                $(document).on('click', '#down', function() {\r
+                       if ($this.fluidbook.help.isVisible()) {\r
+                               return;\r
+                       }\r
                        if ($(this).hasClass('right')) {\r
                                $this.fluidbook.goNextChapter();\r
                        } else {\r
index 614042842c2b8115bc967ed0c2aeec871088cff0..0d5372f4f3eca25d969ae8dfd32f34267f1f3191 100644 (file)
@@ -53,10 +53,10 @@ FluidbookTouch.prototype = {
                return this._move(e.screenX, e.screenY);
        },
        allowMove: function() {
-               return !(this.fluidbook.support.getZoomLevel() <= 1 && !this.fluidbook.viewMode());
+               return !(this.fluidbook.support.getZoomLevel() <= 1  && !this.fluidbook.viewMode());
        },
        allowSlide: function() {
-               return !(this.gesturing || this.fluidbook.support.getZoomLevel() > 1 || this.fluidbook.viewMode());
+               return !(this.gesturing || this.fluidbook.support.getZoomLevel() > 1 || this.fluidbook.viewMode() || this.fluidbook.help.isVisible());
        },
        reset: function() {
                this.startX = 0;
index dbe8ea35b76879996b995f26e6a4ba2962669ef5..1bab2dc17f58ce43ac38e9f235f7fa574276b552 100644 (file)
@@ -11,7 +11,7 @@ var gal = null;
 
 $(function() {
        FastClick.attach(document.body);
-       
+
        $_GET = parseGet();
        INITED = false;
 
@@ -253,7 +253,11 @@ function resize(init) {
 }
 
 function goNextPage(e) {
+       if (fluidbook.help.isVisible()) {
+               return;
+       }
        var y = e.offsetY == undefined ? e.originalEvent.layerY : e.offsetY;
+
        if (y < 65) {
                if (fluidbook.pad.enabled) {
                        fluidbook.goNextChapter();
@@ -267,6 +271,9 @@ function goNextPage(e) {
 }
 
 function goPreviousPage(e) {
+       if (fluidbook.help.isVisible()) {
+               return;
+       }
        var y = e.offsetY == undefined ? e.originalEvent.layerY : e.offsetY;
        if (y < 65) {
                if (fluidbook.pad.enabled) {