From e74cd4e961c3d623e622dd9d56e66ed4992331e4 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sat, 22 Nov 2014 15:39:50 -0800 Subject: [PATCH] Fix Unread.init condition. --- src/Monitoring/Unread.coffee | 4 +++- src/Quotelinks/QuoteThreading.coffee | 14 +++++--------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/Monitoring/Unread.coffee b/src/Monitoring/Unread.coffee index 945cf96ee..ee8bc1d7f 100755 --- a/src/Monitoring/Unread.coffee +++ b/src/Monitoring/Unread.coffee @@ -4,8 +4,10 @@ Unread = !Conf['Unread Count'] and !Conf['Unread Favicon'] and !Conf['Unread Line'] and + !Conf['Scroll to Last Read Post'] and + !Conf['Thread Watcher'] and !Conf['Desktop Notifications'] and - !(Conf['Thread Watcher'] and Conf['Show Unread Count']) + !Conf['Quote Threading'] @db = new DataBoard 'lastReadPosts', @sync @hr = $.el 'hr', diff --git a/src/Quotelinks/QuoteThreading.coffee b/src/Quotelinks/QuoteThreading.coffee index 0fcc84223..ac3d26c41 100755 --- a/src/Quotelinks/QuoteThreading.coffee +++ b/src/Quotelinks/QuoteThreading.coffee @@ -17,7 +17,7 @@ QuoteThreading = el: @controls order: 98 - $.on d, '4chanXInitFinished', @ready unless Conf['Unread Count'] + $.on d, '4chanXInitFinished', @ready Post.callbacks.push name: 'Quote Threading' @@ -30,16 +30,14 @@ QuoteThreading = force: -> g.posts.forEach (post) -> post.cb true if post.cb - - if Conf['Unread Count'] and Unread.thread.OP.nodes.root.parentElement.parentElement - Unread.read() - Unread.update() + Unread.read() + Unread.update() node: -> {posts} = g return if @isClone or not QuoteThreading.enabled - Unread.addPost @ if Conf['Unread Count'] + Unread.addPost @ return if @thread.OP is @ or @isHidden # Filtered keys = [] @@ -64,7 +62,7 @@ QuoteThreading = {bottom, top} = root.getBoundingClientRect() # Post is unread or is fully visible. - return false unless (Conf['Unread Count'] and posts[post.ID]) or ((bottom < height) and (top > 0)) + return false unless posts[post.ID] or ((bottom < height) and (top > 0)) if $.hasClass root, 'threadOP' threadContainer = root.nextElementSibling @@ -78,8 +76,6 @@ QuoteThreading = $.after root, threadContainer $.addClass root, 'threadOP' - return true unless Conf['Unread Count'] - if post = posts[post.ID] posts.after post, posts[@ID]