|
|
@ -38,9 +38,7 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
|
|
|
|
var clickedTid = $(this).parents('li.category-item[data-tid]').attr('data-tid');
|
|
|
|
var clickedTid = $(this).parents('li.category-item[data-tid]').attr('data-tid');
|
|
|
|
$('#topics-container li.category-item').each(function(index, el) {
|
|
|
|
$('#topics-container li.category-item').each(function(index, el) {
|
|
|
|
if($(el).offset().top - $(window).scrollTop() > 0) {
|
|
|
|
if($(el).offset().top - $(window).scrollTop() > 0) {
|
|
|
|
tid = $(el).attr('data-tid');
|
|
|
|
localStorage.setItem('category:bookmark', $(el).attr('data-tid'));
|
|
|
|
|
|
|
|
|
|
|
|
localStorage.setItem('category:bookmark', tid);
|
|
|
|
|
|
|
|
localStorage.setItem('category:bookmark:clicked', clickedTid);
|
|
|
|
localStorage.setItem('category:bookmark:clicked', clickedTid);
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -133,8 +131,9 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
|
|
|
|
|
|
|
|
|
|
|
|
if(!loadingMoreTopics && $('#topics-container').children().length) {
|
|
|
|
if(!loadingMoreTopics && $('#topics-container').children().length) {
|
|
|
|
|
|
|
|
|
|
|
|
var after = 0;
|
|
|
|
var after = 0,
|
|
|
|
var el = null;
|
|
|
|
offset = 0,
|
|
|
|
|
|
|
|
el = null;
|
|
|
|
|
|
|
|
|
|
|
|
if(direction > 0) {
|
|
|
|
if(direction > 0) {
|
|
|
|
el = $('#topics-container .category-item[data-tid]').last();
|
|
|
|
el = $('#topics-container .category-item[data-tid]').last();
|
|
|
@ -146,10 +145,9 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
|
|
|
|
if(after < 0) {
|
|
|
|
if(after < 0) {
|
|
|
|
after = 0;
|
|
|
|
after = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
offset = el.offset().top - $('#header-menu').offset().top + $('#header-menu').height();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var offset = el.offset().top - $('#header-menu').offset().top + $('#header-menu').height();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Category.loadMoreTopics(templates.get('category_id'), after, function() {
|
|
|
|
Category.loadMoreTopics(templates.get('category_id'), after, function() {
|
|
|
|
if(direction < 0 && el) {
|
|
|
|
if(direction < 0 && el) {
|
|
|
|
Category.scrollToTopic(el.attr('data-tid'), null, 0, offset);
|
|
|
|
Category.scrollToTopic(el.attr('data-tid'), null, 0, offset);
|
|
|
@ -199,7 +197,7 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
|
|
|
|
pagination.recreatePaginationLinks(newPageCount);
|
|
|
|
pagination.recreatePaginationLinks(newPageCount);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
$('#topics-container span.timeago').timeago();
|
|
|
|
topic.find('span.timeago').timeago();
|
|
|
|
app.createUserTooltips();
|
|
|
|
app.createUserTooltips();
|
|
|
|
|
|
|
|
|
|
|
|
$(window).trigger('action:categories.new_topic.loaded');
|
|
|
|
$(window).trigger('action:categories.new_topic.loaded');
|
|
|
@ -264,7 +262,7 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$('#topics-container span.timeago').timeago();
|
|
|
|
html.find('span.timeago').timeago();
|
|
|
|
app.createUserTooltips();
|
|
|
|
app.createUserTooltips();
|
|
|
|
app.makeNumbersHumanReadable(html.find('.human-readable-number'));
|
|
|
|
app.makeNumbersHumanReadable(html.find('.human-readable-number'));
|
|
|
|
|
|
|
|
|
|
|
|