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

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

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

Loading…
Cancel
Save