Merge branch 'hrniels-fullscreen' into develop

This commit is contained in:
Tobias Reich 2016-08-09 09:42:34 +02:00
commit 0188cbba38
4 changed files with 12 additions and 18 deletions

View File

@ -67,8 +67,6 @@ header.bind = function() {
header.show = function() { header.show = function() {
clearTimeout($(window).data('timeout'))
lychee.imageview.removeClass('full') lychee.imageview.removeClass('full')
header.dom().removeClass('header--hidden') 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) { if (visible.photo() && !visible.sidebar() && !visible.contextMenu() && basicModal.visible()===false) {
clearTimeout($(window).data('timeout')) lychee.imageview.addClass('full')
header.dom().addClass('header--hidden')
$(window).data('timeout', setTimeout(function() {
lychee.imageview.addClass('full')
header.dom().addClass('header--hidden')
}, delay))
return true return true

View File

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

View File

@ -159,7 +159,7 @@ multiselect.resize = function(e) {
multiselect.stopResize = function() { multiselect.stopResize = function() {
$(document).off('mousemove mouseup') if (multiselect.position.top!==null) $(document).off('mousemove mouseup')
} }

View File

@ -309,9 +309,12 @@ view.photo = {
$('body').css('overflow', 'hidden') $('body').css('overflow', 'hidden')
// Fullscreen // Fullscreen
$(document) var timeout
.bind('mouseenter', header.show) $(document).bind('mousemove', function() {
.bind('mouseleave', header.hide) clearTimeout(timeout)
header.show()
timeout = setTimeout(header.hide, 1000)
})
lychee.animate(lychee.imageview, 'fadeIn') lychee.animate(lychee.imageview, 'fadeIn')
@ -329,8 +332,7 @@ view.photo = {
// Disable Fullscreen // Disable Fullscreen
$(document) $(document)
.unbind('mouseenter') .unbind('mousemove')
.unbind('mouseleave')
// Hide Photo // Hide Photo
lychee.animate(lychee.imageview, 'fadeOut') lychee.animate(lychee.imageview, 'fadeOut')