Improved fullscreen enter/leave in photo view.
Previously, document.mouse{enter,leave} was used for that. This has the disadvantage that is doesn't work when the browser is in fullscreen mode (at least, in Chromium), because the mouse can no longer leave the document. With this commit, mousemove is used to switch to fullscreen in the photo view after the user has not moved the mouse for some time. It is left again, if the user moves the mouse.
This commit is contained in:
parent
475ae5748b
commit
e41b0f81bd
@ -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')
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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, 500)
|
||||||
|
})
|
||||||
|
|
||||||
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')
|
||||||
|
Loading…
Reference in New Issue
Block a user