Only show MD5 quick filter notification when using keybind. #2385

This commit is contained in:
ccd0 2019-08-04 20:27:05 -07:00
parent 46fb24219b
commit c9ebeabb12
2 changed files with 9 additions and 2 deletions

View File

@ -266,7 +266,7 @@ Filter =
ta.setSelectionRange tl, tl ta.setSelectionRange tl, tl
ta.focus() ta.focus()
quickFilterMD5: -> quickFilterMD5: (e) ->
post = Get.postFromNode @ post = Get.postFromNode @
files = post.files.filter((f) -> f.MD5) files = post.files.filter((f) -> f.MD5)
return unless files.length return unless files.length
@ -277,6 +277,13 @@ Filter =
PostHiding.hide origin PostHiding.hide origin
else if g.VIEW is 'index' else if g.VIEW is 'index'
ThreadHiding.hide origin.thread ThreadHiding.hide origin.thread
unless e.type is 'keydown'
# feedback for when nothing gets hidden
if post.nodes.post.getBoundingClientRect().height
new Notice 'info', 'MD5 filtered.', 2
return
{notice} = Filter.quickFilterMD5 {notice} = Filter.quickFilterMD5
if notice if notice
notice.filters.push filter notice.filters.push filter

View File

@ -211,7 +211,7 @@ Keybinds =
return unless threadRoot return unless threadRoot
post = Keybinds.post threadRoot post = Keybinds.post threadRoot
Keybinds.hl +1, threadRoot Keybinds.hl +1, threadRoot
Filter.quickFilterMD5.call post Filter.quickFilterMD5.call post, e
when Conf['Previous Post Quoting You'] when Conf['Previous Post Quoting You']
return unless threadRoot and QuoteYou.db return unless threadRoot and QuoteYou.db
QuoteYou.cb.seek 'preceding' QuoteYou.cb.seek 'preceding'