Use [hidden] as this is easier to work with.

This commit is contained in:
Nicolas Stepien 2012-05-01 16:38:55 +02:00
parent fabd887317
commit 145a6ef581
2 changed files with 10 additions and 6 deletions

View File

@ -943,7 +943,7 @@
button = this.parentNode;
id = button.id.slice(2);
quotes = $$(".quotelink[href$='#p" + id + "'], .backlink[href='#p" + id + "']");
if (/\bhidden_reply\b/.test(button.className)) {
if (button.nextElementSibling.hidden) {
ReplyHiding.show(button);
for (_i = 0, _len = quotes.length; _i < _len; _i++) {
quote = quotes[_i];
@ -961,9 +961,10 @@
return $.set("hiddenReplies/" + g.BOARD + "/", g.hiddenReplies);
},
hide: function(button) {
if (/\bhidden_reply\b/.test(button.className)) {
if (button.nextElementSibling.hidden) {
return;
}
button.nextElementSibling.hidden = true;
$.addClass(button, 'hidden_reply');
if (!Conf['Show Stubs']) {
button.hidden = true;
@ -973,6 +974,7 @@
return $.add(button.firstChild, $.tn(" " + ($('.nameBlock', button.nextElementSibling).textContent)));
},
show: function(button) {
button.nextElementSibling.hidden = false;
$.removeClass(button, 'hidden_reply');
if (!Conf['Show Stubs']) {
button.hidden = false;
@ -4209,7 +4211,7 @@ a[href="javascript:;"] {\
}\
\
.hidden_thread ~ *,\
.hidden_reply + .reply,\
.reply[hidden],\
#content > [name=tab]:not(:checked) + div,\
#updater:not(:hover) > :not(.move),\
#qp > input, #qp .inline, .forwarded {\

View File

@ -746,7 +746,7 @@ ReplyHiding =
button = @parentNode
id = button.id[2..]
quotes = $$ ".quotelink[href$='#p#{id}'], .backlink[href='#p#{id}']"
if /\bhidden_reply\b/.test button.className
if button.nextElementSibling.hidden
ReplyHiding.show button
for quote in quotes
$.removeClass quote, 'filtered'
@ -759,7 +759,8 @@ ReplyHiding =
$.set "hiddenReplies/#{g.BOARD}/", g.hiddenReplies
hide: (button) ->
return if /\bhidden_reply\b/.test button.className # already hidden once by filter
return if button.nextElementSibling.hidden # already hidden once by filter
button.nextElementSibling.hidden = true
$.addClass button, 'hidden_reply'
unless Conf['Show Stubs']
@ -770,6 +771,7 @@ ReplyHiding =
$.add button.firstChild, $.tn " #{$('.nameBlock', button.nextElementSibling).textContent}"
show: (button) ->
button.nextElementSibling.hidden = false
$.removeClass button, 'hidden_reply'
unless Conf['Show Stubs']
@ -3237,7 +3239,7 @@ a[href="javascript:;"] {
}
.hidden_thread ~ *,
.hidden_reply + .reply,
.reply[hidden],
#content > [name=tab]:not(:checked) + div,
#updater:not(:hover) > :not(.move),
#qp > input, #qp .inline, .forwarded {