cleanup...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2023-08-17 17:34:30 +03:00
parent c4783101a0
commit 53eecfc17f

View File

@ -1021,21 +1021,18 @@ var Gallery = {
if(holding_toggle){ if(holding_toggle){
holding_toggle = false holding_toggle = false
evt.preventDefault() evt.preventDefault()
hold_timeout if(hold_timeout){
&& clearTimeout(hold_timeout) clearTimeout(hold_timeout)
hold_timeout = undefined hold_timeout = undefined
that.toggleToolbar() }} that.toggleToolbar() } }}
var collapse_button = toolbar.querySelector('.collapse') var collapse_button = toolbar.querySelector('.collapse')
collapse_button.addEventListener('touchstart', handleInteractionStart) collapse_button.addEventListener('touchstart', handleInteractionStart)
collapse_button.addEventListener('mousedown', handleInteractionStart) collapse_button.addEventListener('mousedown', handleInteractionStart)
// XXX should these be on document??? collapse_button.addEventListener('touchend', handleInteractionEnd)
// ...if yes we'll need to be carefull with .preventDefault(..) collapse_button.addEventListener('mouseup', handleInteractionEnd)
document.addEventListener('touchend', handleInteractionEnd)
document.addEventListener('mouseup', handleInteractionEnd)
// toolbar: autohide... // toolbar: autohide...
var hide_timeout var hide_timeout
// XXX does not work correctly with touch...
var toolbarAutoHideTimerStart = function(evt){ var toolbarAutoHideTimerStart = function(evt){
if(that.toolbar_autohide == 0 if(that.toolbar_autohide == 0
|| toolbar.classList.contains('sticky')){ || toolbar.classList.contains('sticky')){