diff --git a/src/General/Config.coffee b/src/General/Config.coffee index 10e2625c9..e115723b3 100755 --- a/src/General/Config.coffee +++ b/src/General/Config.coffee @@ -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 diff --git a/src/Images/Gallery.coffee b/src/Images/Gallery.coffee index 7e1e5f9e9..23eace7f7 100644 --- a/src/Images/Gallery.coffee +++ b/src/Images/Gallery.coffee @@ -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 = ''