Browse Source

ukko: bugfixes

pull/40/head
czaks 11 years ago
parent
commit
3922677968
  1. 14
      templates/themes/ukko/ukko.js

14
templates/themes/ukko/ukko.js

@ -35,12 +35,12 @@ $(document).ready(function() {
ukkohide.click(function() {
hiddenboards[board] = (hiddenboards[board] !== true);
if (hiddenboards[board] !== true) {
$('[data-board="'+board+'"][data-cached!="yes"]').show().prev().
$('[data-board="'+board+'"]:not([data-cached="yes"])').show().prev().
find('.ukkohide').html(_("(hide threads from this board)")).
parent().find('hr').hide();
}
else {
$('[data-board="'+board+'"][data-cached!="yes"]').hide().prev().
$('[data-board="'+board+'"]:not([data-cached="yes"])').hide().prev().
find('.ukkohide').html(_("(show threads from this board)"))
.parent().find('hr').show();
}
@ -59,7 +59,7 @@ $(document).ready(function() {
while($(window).scrollTop() + $(window).height() + 500 > $(document).height() && !loading && overflow.length > 0) {
var page = '../' + overflow[0].board + '/' + overflow[0].page;
thread = $('div#thread_' + overflow[0].id + '[data-board="' + overflow[0].board + '"]');
if (thread.length > 0 && thread.data("cached") !== 'yes') { // already present
if (thread.length > 0 && thread.attr("data-cached") !== 'yes') { // already present
overflow.shift();
continue;
}
@ -67,7 +67,7 @@ $(document).ready(function() {
var boardheader = $('<h2><a href="/' + overflow[0].board + '/">/' + overflow[0].board + '/</a> </h2>');
if($.inArray(page, cache) != -1 && thread.length > 0) {
$('div[id*="thread_"]').last().after(thread.attr('data-board', overflow[0].board).data("cached", "no").css('display', 'block'));
$('div[id*="thread_"]').last().after(thread.attr('data-board', overflow[0].board).attr("data-cached", "no").css('display', 'block'));
boardheader.insertBefore(thread);
addukkohide.call(boardheader);
$(document).trigger('new_post', thread);
@ -79,12 +79,12 @@ $(document).ready(function() {
cache.push(page);
$(data).find('div[id*="thread_"]').each(function() {
$('form[name="postcontrols"]').prepend($(this).css('display', 'none').data("cached", "yes").attr('data-board', overflow[0].board));
$('form[name="postcontrols"]').prepend($(this).css('display', 'none').attr("data-cached", "yes").attr('data-board', overflow[0].board));
});
thread = $('div#thread_' + overflow[0].id + '[data-board="' + overflow[0].board + '"]');
if(thread.length > 0 && thread.data('cached') !== 'no') {
$('div[id*="thread_"]').last().after(thread.attr('data-board', overflow[0].board).data("cached", "no").css('display', 'block'));
if(thread.length > 0 && thread.attr('data-cached') !== 'no') {
$('div[id*="thread_"]').last().after(thread.attr('data-board', overflow[0].board).attr("data-cached", "no").css('display', 'block'));
boardheader.insertBefore(thread);
addukkohide.call(boardheader);
$(document).trigger('new_post', thread);

Loading…
Cancel
Save