diff --git a/public/src/modules/navigator.js b/public/src/modules/navigator.js index d30539db5b..3bef847038 100644 --- a/public/src/modules/navigator.js +++ b/public/src/modules/navigator.js @@ -373,12 +373,7 @@ define('navigator', ['forum/pagination', 'components', 'hooks', 'alerts'], funct } }; - navigator.update = function (threshold) { - /* - The "threshold" is defined as the distance from the top of the page to - a spot where a user is expecting to begin reading. - */ - threshold = typeof threshold === 'number' ? threshold : undefined; + navigator.update = function () { let newIndex = index; const els = $(navigator.selector); if (els.length) { @@ -415,21 +410,8 @@ define('navigator', ['forum/pagination', 'components', 'hooks', 'alerts'], funct newIndex = count; } - // If a threshold is undefined, try to determine one based on new index - if (threshold === undefined && ajaxify.data.template.topic) { - if (atTop) { - threshold = 0; - } else { - const anchorEl = components.get('post/anchor', index - 1); - if (anchorEl.length) { - const anchorRect = anchorEl.get(0).getBoundingClientRect(); - threshold = anchorRect.top; - } - } - } - if (typeof navigator.callback === 'function') { - navigator.callback(newIndex, count, threshold); + navigator.callback(newIndex, count); } if (newIndex !== index) { @@ -445,6 +427,9 @@ define('navigator', ['forum/pagination', 'components', 'hooks', 'alerts'], funct navigator.setIndex = (newIndex) => { index = newIndex + 1; + if (typeof navigator.callback === 'function') { + navigator.callback(index, count); + } navigator.updateTextAndProgressBar(); setThumbToIndex(index); };