From: Stephen Cameron Date: Tue, 28 Mar 2017 08:07:36 +0000 (+0200) Subject: Fix auto-hide on mobile/touch devices. #1180 @0:10 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=792ebcc5be23edf489e06b96fa46e81e3fcbcf73;p=fluidbook-html5.git Fix auto-hide on mobile/touch devices. #1180 @0:10 --- diff --git a/js/libs/fluidbook/fluidbook.help.js b/js/libs/fluidbook/fluidbook.help.js index 8ee9f853..bda1442d 100644 --- a/js/libs/fluidbook/fluidbook.help.js +++ b/js/libs/fluidbook/fluidbook.help.js @@ -120,8 +120,13 @@ FluidbookHelp.prototype = { } // Click handler on main helpView div to hide it - $this.view.click(function() { - $this.hide(); + $this.view.click(function(e) { + e.stopImmediatePropagation(); + e.stopPropagation(); + e.preventDefault(); + + $this.hide(); + return false; }); }, isVisible: function() { @@ -146,22 +151,13 @@ FluidbookHelp.prototype = { this.view.show(); $("#previous,#next").addClass('help'); this.fluidbook.showAllButtons(); - if (this.fluidbook.support.isMobile) { - $(document).one('click t', function(e) { - e.stopImmediatePropagation(); - e.stopPropagation(); - e.preventDefault(); - $this.hide(); - return false; - }); - } else { - if (time != 0) { - this.autoTimeout = setTimeout(function() { - $this.hide(); - }, time * 1000); - } - } + if (time != 0) { + this.autoTimeout = setTimeout(function() { + $this.hide(); + }, time * 1000); + } + return false; }, hide: function() {