v1.18.x
barisusakli 9 years ago
parent 53d29e29af
commit 6b1834d4ae

@ -14,7 +14,7 @@ define('forum/category', [
$(window).on('action:ajaxify.start', function(ev, data) {
if (ajaxify.currentPage !== data.url) {
navigator.hide();
navigator.disable();
removeListeners();
}
@ -39,12 +39,12 @@ define('forum/category', [
sort.handleSort('categoryTopicSort', 'user.setCategorySort', 'category/' + ajaxify.data.slug);
enableInfiniteLoadingOrPagination();
if (!config.usePagination) {
navigator.init('[component="category/topic"]', ajaxify.data.topic_count, Category.toTop, Category.toBottom, Category.navigatorCallback);
}
enableInfiniteLoadingOrPagination();
$('[component="category"]').on('click', '[component="topic/header"]', function() {
var clickedIndex = $(this).parents('[data-index]').attr('data-index');
$('[component="category/topic"]').each(function(index, el) {
@ -173,7 +173,7 @@ define('forum/category', [
if (!config.usePagination) {
infinitescroll.init($('[component="category"]'), Category.loadMoreTopics);
} else {
navigator.hide();
navigator.disable();
}
}

@ -19,7 +19,7 @@ define('forum/topic', [
$(window).on('action:ajaxify.start', function(ev, data) {
if (ajaxify.currentPage !== data.url) {
navigator.hide();
navigator.disable();
components.get('navbar/title').find('span').text('').hide();
app.removeAlert('bookmark');
@ -216,7 +216,7 @@ define('forum/topic', [
if (!config.usePagination) {
infinitescroll.init($('[component="topic"]'), posts.loadMorePosts);
} else {
navigator.hide();
navigator.disable();
}
}

@ -18,7 +18,7 @@ define('navigator', ['forum/pagination', 'components'], function(pagination, com
toTop = toTop || function() {};
toBottom = toBottom || function() {};
$(window).on('scroll', navigator.update);
$(window).off('scroll', navigator.update).on('scroll', navigator.update);
$('.pagination-block .dropdown-menu').off('click').on('click', function(e) {
e.stopPropagation();
@ -74,7 +74,12 @@ define('navigator', ['forum/pagination', 'components'], function(pagination, com
toggle(true);
};
navigator.hide = function() {
navigator.disable = function() {
count = 0;
index = 1;
navigator.selector = navigator.callback = null;
$(window).off('scroll', navigator.update);
toggle(false);
};

Loading…
Cancel
Save