Implement Fullscreen Gallery option.
This commit is contained in:
parent
a710bdf8b4
commit
e9802b3458
@ -165,7 +165,11 @@ Config =
|
||||
]
|
||||
'Gallery': [
|
||||
true
|
||||
'Adds a simple and cute image gallery.'
|
||||
'Adds a simple and cute image gallery.'
|
||||
]
|
||||
'Fullscreen Gallery': [
|
||||
true
|
||||
'Open gallery in fullscreen mode.'
|
||||
]
|
||||
'PDF in Gallery': [
|
||||
false
|
||||
|
||||
@ -78,6 +78,9 @@ Gallery =
|
||||
candidate = post.file.thumb.parentNode
|
||||
if Header.getTopOf(candidate) + candidate.getBoundingClientRect().height >= 0
|
||||
image = candidate
|
||||
if Conf['Fullscreen Gallery']
|
||||
doc.mozRequestFullScreen?()
|
||||
doc.webkitRequestFullScreen?(Element.ALLOW_KEYBOARD_INPUT)
|
||||
$.addClass doc, 'gallery-open'
|
||||
$.add d.body, dialog
|
||||
|
||||
@ -261,6 +264,9 @@ Gallery =
|
||||
Gallery.nodes.current.pause?()
|
||||
$.rm Gallery.nodes.el
|
||||
$.rmClass doc, 'gallery-open'
|
||||
if Conf['Fullscreen Gallery']
|
||||
d.mozCancelFullScreen?()
|
||||
d.webkitExitFullscreen?()
|
||||
delete Gallery.nodes
|
||||
delete Gallery.fullIDs
|
||||
doc.style.overflow = ''
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user