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