Removed duplicated timeout for header.

Because of that, the timeout for going into fullscreen mode
has been changed from 500ms to 1s.
This commit is contained in:
Nils Asmussen 2016-08-06 15:19:55 +02:00
parent e41b0f81bd
commit 8181bd6ce6
3 changed files with 5 additions and 13 deletions

View File

@ -67,8 +67,6 @@ header.bind = function() {
header.show = function() {
clearTimeout($(window).data('timeout'))
lychee.imageview.removeClass('full')
header.dom().removeClass('header--hidden')
@ -76,18 +74,12 @@ header.show = function() {
}
header.hide = function(e, delay = 500) {
header.hide = function(e) {
if (visible.photo() && !visible.sidebar() && !visible.contextMenu() && basicModal.visible()===false) {
clearTimeout($(window).data('timeout'))
$(window).data('timeout', setTimeout(function() {
lychee.imageview.addClass('full')
header.dom().addClass('header--hidden')
}, delay))
lychee.imageview.addClass('full')
header.dom().addClass('header--hidden')
return true

View File

@ -80,7 +80,7 @@ $(document).ready(function() {
// Fullscreen on mobile
.on('touchend', '#imageview #image', function(e) {
if (swipe.obj==null || (swipe.offset>=-5&&swipe.offset<=5)) {
if (visible.header()) header.hide(e, 0)
if (visible.header()) header.hide(e)
else header.show()
}
})

View File

@ -313,7 +313,7 @@ view.photo = {
$(document).bind('mousemove', function() {
clearTimeout(timeout)
header.show()
timeout = setTimeout(header.hide, 500)
timeout = setTimeout(header.hide, 1000)
})
lychee.animate(lychee.imageview, 'fadeIn')