add keybinds for toggling slideshow and video pausing

This commit is contained in:
ccd0 2014-07-05 12:56:58 -07:00
parent a5494c8a2e
commit 815f58be8b
2 changed files with 7 additions and 2 deletions

View File

@ -1,7 +1,7 @@
<div class="gal-viewport">
<span class="gal-buttons">
<a href="javascript:;" class="gal-start" title="Start slideshow"><i></i></a>
<a href="javascript:;" class="gal-stop" title="Stop slideshow"><i></i></a>
<a href="javascript:;" class="gal-start" title="Start slideshow (S to toggle)"><i></i></a>
<a href="javascript:;" class="gal-stop" title="Stop slideshow (S to toggle)"><i></i></a>
<a href="javascript:;" class="menu-button"><i></i></a>
<a href="javascript:;" class="gal-close">×</a>
</span>

View File

@ -125,6 +125,10 @@ Gallery =
Gallery.cb.advanceKey
when 'Left', ''
Gallery.cb.prev
when 'p'
Gallery.cb.pause
when 's'
Gallery.cb.toggleSlideshow
return unless cb
e.stopPropagation()
@ -203,6 +207,7 @@ Gallery =
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()