From ac9b152a64dcaab0ae91df7b3d2f6dae7a3a7a94 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sat, 5 Jul 2014 17:40:42 -0700 Subject: [PATCH] clicking the image stops the slideshow --- src/General/Config.coffee | 2 +- src/Images/Gallery.coffee | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/General/Config.coffee b/src/General/Config.coffee index 0945582a1..71a987e05 100755 --- a/src/General/Config.coffee +++ b/src/General/Config.coffee @@ -444,7 +444,7 @@ Config = 'Advance to next post when contracting an expanded image.' ] - gallery : + gallery: 'Hide Thumbnails': [ false ] diff --git a/src/Images/Gallery.coffee b/src/Images/Gallery.coffee index 4787fa113..14aaeb5e5 100644 --- a/src/Images/Gallery.coffee +++ b/src/Images/Gallery.coffee @@ -54,7 +54,7 @@ Gallery = {cb} = Gallery $.on nodes.frame, 'click', cb.blank - $.on nodes.next, 'click', cb.advance + $.on nodes.next, 'click', cb.click $.on $('.gal-prev', dialog), 'click', cb.prev $.on $('.gal-next', dialog), 'click', cb.next $.on $('.gal-start', dialog), 'click', cb.start @@ -118,7 +118,7 @@ Gallery = when 'Right' Gallery.cb.next when 'Enter' - Gallery.cb.advanceKey + Gallery.cb.advance when 'Left', '' Gallery.cb.prev when 'p' @@ -200,15 +200,17 @@ Gallery = prev: -> Gallery.cb.open.call Gallery.images[+Gallery.nodes.current.dataset.id - 1] next: -> Gallery.cb.open.call Gallery.images[+Gallery.nodes.current.dataset.id + 1] + advance: -> if Gallery.nodes.current.paused then return Gallery.nodes.current.play() else Gallery.cb.next() toggle: -> (if Gallery.nodes then Gallery.cb.close else Gallery.build)() blank: (e) -> Gallery.cb.close() if e.target is @ - advance: -> Gallery.cb.advanceKey() unless Gallery.nodes.current.controls toggleSlideshow: -> Gallery.cb[if Gallery.slideshow then 'stop' else 'start']() - advanceKey: -> - if Gallery.nodes.current.paused then return Gallery.nodes.current.play() - Gallery.cb.next() - + click: -> + if Gallery.slideshow + Gallery.cb.stop() + else unless Gallery.nodes.current.controls + Gallery.cb.advance() + pause: -> {current} = Gallery.nodes current[if current.paused then 'play' else 'pause']() if current.nodeName is 'VIDEO'