瀏覽代碼

Scroll as read: keep unread function

https://github.com/FreshRSS/FreshRSS/pull/1309
Alexandre Alapetite 9 年之前
父節點
當前提交
3f78bad397
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      p/scripts/main.js

+ 2 - 1
p/scripts/main.js

@@ -144,6 +144,7 @@ function mark_read(active, only_not_read) {
 			inc--;
 		} else if (only_not_read !== true || active.hasClass("not_read")) {
 			active.addClass("not_read");
+			active.addClass("keep_unread");
 			inc++;
 		}
 		$r.find('.icon').replaceWith(data.icon);
@@ -451,7 +452,7 @@ function auto_share(key) {
 
 function scrollAsRead(box_to_follow) {
 	var minTop = 40 + (context.current_view === 'global' ? box_to_follow.offset().top : box_to_follow.scrollTop());
-	$('.not_read:visible').each(function () {
+	$('.not_read:not(.keep_unread):visible').each(function () {
 			var $this = $(this);
 			if ($this.offset().top + $this.height() < minTop) {
 				mark_read($this, true);