]> _ Git - fluidbook-html5.git/commitdiff
Fix auto-hide on mobile/touch devices. #1180 @0:10
authorStephen Cameron <stephen@cubedesigners.com>
Tue, 28 Mar 2017 08:07:36 +0000 (10:07 +0200)
committerStephen Cameron <stephen@cubedesigners.com>
Tue, 28 Mar 2017 08:07:36 +0000 (10:07 +0200)
js/libs/fluidbook/fluidbook.help.js

index 8ee9f8530b1f282768623a8edd3ab1fd8d470a51..bda1442d13e87eb911e1c537e98c8cf8d4815e39 100644 (file)
@@ -120,8 +120,13 @@ FluidbookHelp.prototype = {
                }\r
 \r
                // Click handler on main helpView div to hide it\r
-               $this.view.click(function() {\r
-                       $this.hide();\r
+               $this.view.click(function(e) {\r
+            e.stopImmediatePropagation();\r
+            e.stopPropagation();\r
+            e.preventDefault();\r
+\r
+            $this.hide();\r
+            return false;\r
                });\r
        },\r
        isVisible: function() {\r
@@ -146,22 +151,13 @@ FluidbookHelp.prototype = {
                this.view.show();\r
                $("#previous,#next").addClass('help');\r
                this.fluidbook.showAllButtons();\r
-               if (this.fluidbook.support.isMobile) {\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
-                               this.autoTimeout = setTimeout(function() {\r
-                                       $this.hide();\r
-                               }, time * 1000);\r
-                       }\r
-               }\r
+        if (time != 0) {\r
+            this.autoTimeout = setTimeout(function() {\r
+                $this.hide();\r
+            }, time * 1000);\r
+        }\r
+\r
                return false;\r
        },\r
        hide: function() {\r