mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-06 07:40:43 +01:00
dont update if index didnt change
This commit is contained in:
@@ -61,7 +61,11 @@ define('navigator', ['forum/pagination', 'components'], function (pagination, co
|
||||
e.stopPropagation();
|
||||
var x = Math.min($(window).width(), Math.max(0, e.touches[0].clientX));
|
||||
var percent = x / $(window).width();
|
||||
index = Math.floor(count * percent);
|
||||
var newIndex = Math.floor(count * percent);
|
||||
if (newIndex === index) {
|
||||
return;
|
||||
}
|
||||
index = newIndex;
|
||||
navigator.updateTextAndProgressBar();
|
||||
}).on('touchend', function () {
|
||||
navigator.scrollToIndex(index - 1, true);
|
||||
|
||||
Reference in New Issue
Block a user