From 3922677968cd4228be0e37943de131282b9eb1e4 Mon Sep 17 00:00:00 2001 From: czaks Date: Fri, 2 Aug 2013 04:36:08 -0400 Subject: [PATCH] ukko: bugfixes --- templates/themes/ukko/ukko.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/templates/themes/ukko/ukko.js b/templates/themes/ukko/ukko.js index 9011c754..11617593 100644 --- a/templates/themes/ukko/ukko.js +++ b/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 = $('

/' + overflow[0].board + '/

'); 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);