diff --git a/src/General/Index.coffee b/src/General/Index.coffee index 7a6214d4a..232788cc7 100644 --- a/src/General/Index.coffee +++ b/src/General/Index.coffee @@ -185,16 +185,10 @@ Index = true catalogNode: -> - $.on @nodes.thumb.parentNode, 'click', Index.onClick - - onClick: (e) -> - return if e.button isnt 0 - thread = g.threads[@parentNode.dataset.fullID] - if e.shiftKey - Index.toggleHide thread - else - return - e.preventDefault() + $.on @nodes.root, 'mousedown click', (e) -> + return unless e.button is 0 and e.shiftKey + Index.toggleHide g.threads[@dataset.fullID] if e.type is 'click' + e.preventDefault() # Also on mousedown to prevent highlighting text. toggleHide: (thread) -> $.rm thread.catalogView.nodes.root diff --git a/src/Monitoring/ThreadWatcher.coffee b/src/Monitoring/ThreadWatcher.coffee index 56a18d8d2..06bbb2a8c 100644 --- a/src/Monitoring/ThreadWatcher.coffee +++ b/src/Monitoring/ThreadWatcher.coffee @@ -97,13 +97,10 @@ ThreadWatcher = catalogNode: -> $.addClass @nodes.root, 'watched' if ThreadWatcher.isWatched @thread - $.on @nodes.thumb.parentNode, 'click', (e) => + $.on @nodes.root, 'mousedown click', (e) -> return unless e.button is 0 and e.altKey - ThreadWatcher.toggle @thread - e.preventDefault() - $.on @nodes.thumb.parentNode, 'mousedown', (e) -> - # Prevent highlighting thumbnail in Firefox. - e.preventDefault() if e.button is 0 and e.altKey + ThreadWatcher.toggle g.threads[@dataset.fullID] if e.type is 'click' + e.preventDefault() # Also on mousedown to prevent highlighting thumbnail in Firefox. addDialog: -> return unless Main.isThisPageLegit()