From 86b019ec89b9a2429417e98024480cb667f5bb25 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Fri, 29 Nov 2013 13:30:01 -0500 Subject: [PATCH] paginator progress bar --- public/src/forum/topic.js | 4 ++++ public/templates/header.tpl | 3 +++ 2 files changed, 7 insertions(+) diff --git a/public/src/forum/topic.js b/public/src/forum/topic.js index decd148ddc..f8337bf636 100644 --- a/public/src/forum/topic.js +++ b/public/src/forum/topic.js @@ -783,10 +783,12 @@ define(function() { var windowHeight = jQuery(window).height(); var scrollTop = jQuery(window).scrollTop(); var scrollBottom = scrollTop + windowHeight; + var progressBar = $('.progress-bar'); if (scrollTop < 50 && Topic.postCount > 1) { localStorage.removeItem("topic:" + tid + ":bookmark"); pagination.innerHTML = '0 out of ' + Topic.postCount; + progressBar.width(0); return; } @@ -813,6 +815,8 @@ define(function() { } pagination.innerHTML = this.postnumber + ' out of ' + Topic.postCount; + console.log((this.postnumber / Topic.postCount * 100) + '%'); + progressBar.width((this.postnumber / Topic.postCount * 100) + '%'); } }); diff --git a/public/templates/header.tpl b/public/templates/header.tpl index a772db3b6e..123c3cd114 100644 --- a/public/templates/header.tpl +++ b/public/templates/header.tpl @@ -141,6 +141,9 @@ +
+
+