Simplify and remove a needless condition.

This commit is contained in:
ccd0 2019-07-22 17:13:30 -07:00
parent 990bc968bb
commit 875f2c06a5

View File

@ -113,10 +113,11 @@ Keybinds =
# Images # Images
when Conf['Expand image'] when Conf['Expand image']
return unless ImageExpand.enabled and threadRoot return unless ImageExpand.enabled and threadRoot
Keybinds.img threadRoot post = Get.postFromNode Keybinds.post threadRoot
ImageExpand.toggle post if post.file
when Conf['Expand images'] when Conf['Expand images']
return unless ImageExpand.enabled and threadRoot return unless ImageExpand.enabled
Keybinds.img threadRoot, true ImageExpand.cb.toggleAll()
when Conf['Open Gallery'] when Conf['Open Gallery']
return unless Gallery.enabled return unless Gallery.enabled
Gallery.cb.toggle() Gallery.cb.toggle()
@ -304,13 +305,6 @@ Keybinds =
"" ""
else "sage" else "sage"
img: (thread, all) ->
if all
ImageExpand.cb.toggleAll()
else
post = Get.postFromNode Keybinds.post thread
ImageExpand.toggle post if post.file
open: (thread, tab) -> open: (thread, tab) ->
return if g.VIEW isnt 'index' return if g.VIEW isnt 'index'
url = "/#{thread.board}/thread/#{thread}" url = "/#{thread.board}/thread/#{thread}"