From 53eecfc17f56d2aa9f4aa320db61fe437621fb64 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Thu, 17 Aug 2023 17:34:30 +0300 Subject: [PATCH] cleanup... Signed-off-by: Alex A. Naanou --- grid-n-view.js | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/grid-n-view.js b/grid-n-view.js index 365984f..f9d0672 100644 --- a/grid-n-view.js +++ b/grid-n-view.js @@ -1021,21 +1021,18 @@ var Gallery = { if(holding_toggle){ holding_toggle = false evt.preventDefault() - hold_timeout - && clearTimeout(hold_timeout) - hold_timeout = undefined - that.toggleToolbar() }} + if(hold_timeout){ + clearTimeout(hold_timeout) + hold_timeout = undefined + that.toggleToolbar() } }} var collapse_button = toolbar.querySelector('.collapse') collapse_button.addEventListener('touchstart', handleInteractionStart) collapse_button.addEventListener('mousedown', handleInteractionStart) - // XXX should these be on document??? - // ...if yes we'll need to be carefull with .preventDefault(..) - document.addEventListener('touchend', handleInteractionEnd) - document.addEventListener('mouseup', handleInteractionEnd) + collapse_button.addEventListener('touchend', handleInteractionEnd) + collapse_button.addEventListener('mouseup', handleInteractionEnd) // toolbar: autohide... var hide_timeout - // XXX does not work correctly with touch... var toolbarAutoHideTimerStart = function(evt){ if(that.toolbar_autohide == 0 || toolbar.classList.contains('sticky')){