mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-07 06:25:50 +01:00
cleaned updateHeader
This commit is contained in:
@@ -983,8 +983,6 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
function updateHeader() {
|
function updateHeader() {
|
||||||
var paginationEl = $('#pagination');
|
|
||||||
|
|
||||||
$('.pagination-block a').off('click').on('click', function() {
|
$('.pagination-block a').off('click').on('click', function() {
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
@@ -997,13 +995,7 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
|
|||||||
app.scrollToBottom();
|
app.scrollToBottom();
|
||||||
});
|
});
|
||||||
|
|
||||||
var windowHeight = jQuery(window).height();
|
if($(window).scrollTop() > 50) {
|
||||||
var scrollTop = jQuery(window).scrollTop();
|
|
||||||
var scrollBottom = scrollTop + windowHeight;
|
|
||||||
var progressBar = $('.progress-bar');
|
|
||||||
var tid = templates.get('topic_id');
|
|
||||||
|
|
||||||
if(scrollTop > 50) {
|
|
||||||
$('#header-topic-title').text(templates.get('topic_name')).show();
|
$('#header-topic-title').text(templates.get('topic_name')).show();
|
||||||
} else {
|
} else {
|
||||||
$('#header-topic-title').text('').hide();
|
$('#header-topic-title').text('').hide();
|
||||||
@@ -1017,8 +1009,8 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
|
|||||||
if(index > Topic.postCount) {
|
if(index > Topic.postCount) {
|
||||||
index = Topic.postCount;
|
index = Topic.postCount;
|
||||||
}
|
}
|
||||||
paginationEl.html(index + ' out of ' + Topic.postCount);
|
$('#pagination').html(index + ' out of ' + Topic.postCount);
|
||||||
progressBar.width((index / Topic.postCount * 100) + '%');
|
$('.progress-bar').width((index / Topic.postCount * 100) + '%');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -1028,9 +1020,9 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
|
|||||||
if (elementInView(el)) {
|
if (elementInView(el)) {
|
||||||
var index = parseInt(el.attr('data-index'), 10) + 1;
|
var index = parseInt(el.attr('data-index'), 10) + 1;
|
||||||
if(index === 0) {
|
if(index === 0) {
|
||||||
localStorage.removeItem("topic:" + tid + ":bookmark");
|
localStorage.removeItem("topic:" + templates.get('topic_id') + ":bookmark");
|
||||||
} else {
|
} else {
|
||||||
localStorage.setItem("topic:" + tid + ":bookmark", el.attr('data-pid'));
|
localStorage.setItem("topic:" + templates.get('topic_id') + ":bookmark", el.attr('data-pid'));
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user