Node.js based forum software built for the modern web
fix navigator method not getting removed
barisusaklib84f36cc201c
diff --git a/public/src/modules/navigator.js b/public/src/modules/navigator.jsindex a70ca1939a..de49cfd1f7 100644--- a/public/src/modules/navigator.js+++ b/public/src/modules/navigator.js@@ -9,6 +9,8 @@ define('navigator', ['forum/pagination', 'components'], function(pagination, comvar navigator = {};var index = 1;var count = 0;+ var navigatorUpdateTimeoutId = 0;+navigator.scrollActive = false;navigator.init = function(selector, count, toTop, toBottom, callback, calculateIndex) {@@ -17,15 +19,8 @@ define('navigator', ['forum/pagination', 'components'], function(pagination, comnavigator.callback = callback;toTop = toTop || function() {};toBottom = toBottom || function() {};- var navigatorUpdateTimeoutId = 0;- $(window).off('scroll', navigator.update).on('scroll', function() {- if (navigatorUpdateTimeoutId) {- clearTimeout(navigatorUpdateTimeoutId);- navigatorUpdateTimeoutId = 0;- }- navigatorUpdateTimeoutId = setTimeout(navigator.update, 100);- });+ $(window).off('scroll', navigator.delayedUpdate).on('scroll', navigator.delayedUpdate);$('.pagination-block .dropdown-menu').off('click').on('click', function(e) {e.stopPropagation();@@ -98,6 +93,14 @@ define('navigator', ['forum/pagination', 'components'], function(pagination, com$('.pagination-block').toggleClass('ready', flag);}+ navigator.delayedUpdate = function() {+ if (navigatorUpdateTimeoutId) {+ clearTimeout(navigatorUpdateTimeoutId);+ navigatorUpdateTimeoutId = 0;+ }+ navigatorUpdateTimeoutId = setTimeout(navigator.update, 100);+ };+navigator.update = function(threshold) {/*The "threshold" is defined as the distance from the top of the page to@@ -136,7 +139,7 @@ define('navigator', ['forum/pagination', 'components'], function(pagination, com} else if (nearBottom) {index = count;}-+console.log('wtf', index ,count)// If a threshold is undefined, try to determine one based on new indexif (threshold === undefined && ajaxify.data.template.topic === true) {if (atTop) {