From b912dcb2f03951cbfd860a3c84aaa0472a5bc6b2 Mon Sep 17 00:00:00 2001 From: Baris Soner Usakli Date: Wed, 12 Feb 2014 16:02:07 -0500 Subject: [PATCH] topic title --- public/src/forum/topic.js | 11 +++++++---- public/templates/header.tpl | 4 ++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/public/src/forum/topic.js b/public/src/forum/topic.js index 7006763991..ac4ee4a0de 100644 --- a/public/src/forum/topic.js +++ b/public/src/forum/topic.js @@ -1075,17 +1075,20 @@ define(['composer', 'forum/pagination'], function(composer, pagination) { var progressBar = $('.progress-bar'); var tid = templates.get('topic_id'); + if(scrollTop > 50) { + $('#header-topic-title').html(templates.get('topic_name')).show(); + } else { + $('#header-topic-title').html('').hide(); + } + if (scrollTop < jQuery('.posts > .post-row:first-child').height() && Topic.postCount > 1) { localStorage.removeItem("topic:" + tid + ":bookmark"); paginationEl.html('1 out of ' + Topic.postCount); progressBar.width(0); - $('#header-topic-title').html('').hide(); + return; } - $('#header-topic-title').html(templates.get('topic_name')).show(); - - var count = 0, smallestNonNegative = 0; jQuery('.posts > .post-row:not(".deleted")').each(function() { diff --git a/public/templates/header.tpl b/public/templates/header.tpl index e248b8384d..dc3eee001b 100644 --- a/public/templates/header.tpl +++ b/public/templates/header.tpl @@ -199,9 +199,9 @@ - +