From dcaa6888b97e2cfae0e4de07a2975718da8ab500 Mon Sep 17 00:00:00 2001 From: Ahmed Mazen Date: Thu, 6 Jul 2023 17:51:35 +0800 Subject: [PATCH] make buttons visible in mobile version of presentation mode in slides Slides hides the buttons needed for navigation and exiting in presentation mode. This makes sense because when doing a presentation, a user would prefer to not have button icons all over their presentation content. When a user hovers on the presentation, the needed buttons become visible again. This commit makes mobile touch act similarily to hovering over the presentation. --- www/slide/slide.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/www/slide/slide.js b/www/slide/slide.js index 66182049c..ce44bb51b 100644 --- a/www/slide/slide.js +++ b/www/slide/slide.js @@ -205,14 +205,23 @@ define([ var addEvent = function () { console.log($modal); var icon_to; - $modal.mousemove(function () { + var mousemove = function () { + console.log($modal); var $buttons = $modal.find('.cp-app-slide-modal-button'); $buttons.show(); + if (icon_to) { window.clearTimeout(icon_to); } icon_to = window.setTimeout(function() { $buttons.fadeOut(); }, 1000); - }); + } + + $modal.mousemove(mousemove); + $modal.on('touchstart', mousemove); + $modal.on('touchend', mousemove); + $modal.on('touchcancel', mousemove); + $modal.on('touchmove', mousemove); + $modal.find('#cp-app-slide-modal-exit').click(function () { var ev = $.Event("keyup"); ev.which = 27;