Permalink
Browse files

Merge pull request #11 from stevenleeg/master

Collapsing changes
  • Loading branch information...
2 parents 2a9678f + 2efb623 commit 65364b159d28292f027d080ab9ca69e1c742ef1a @tommoor committed Mar 15, 2013
Showing with 8 additions and 20 deletions.
  1. +0 −14 hn.css
  2. +8 −6 js/hn.js
View
14 hn.css
@@ -411,10 +411,7 @@ font u a:visited,
}
a.toggle-replies {
- float: right;
cursor: pointer;
- opacity: 0;
- -webkit-transition: all 0.2s ease-in-out;
}
a.toggle-replies:hover {
@@ -425,17 +422,6 @@ td.default:hover a.toggle-replies {
opacity: 1;
}
-a.toggle-replies.collapsed {
- opacity: 1;
-
- padding: 3px 6px;
- margin: -5px;
- background: #828282;
- color: white;
- border-radius: 3px;
-}
-
-
/*********** Inline Replies ***********/
#quick-reply {
View
@@ -260,9 +260,10 @@ var hn = {
if ($button.hasClass('collapsed')) {
var uniq = $button.data('uniq');
- $('.hidden-reply-' + uniq).fadeIn().removeClass();
- $button.text('collapse')
+ $('.hidden-reply-' + uniq).show().removeClass();
+ $button.text('[-]')
.removeClass('collapsed');
+ $button.parent().parent().parent().children(".comment, p").show();
return;
}
@@ -278,16 +279,17 @@ var hn = {
count++;
// find parent tr, several levels down
- $(this).parent().parent().parent().parent().parent().fadeOut().addClass('hidden-reply-' + uniq);
+ $(this).parent().parent().parent().parent().parent().hide().addClass('hidden-reply-' + uniq);
return true;
}
// gone too far
return false;
}
});
+ $button.parents("td.default").children("span.comment, p").hide();
- $button.text('show ' + count + ' replies')
+ $button.text("[+]")
.addClass('collapsed')
.data('uniq', uniq);
},
@@ -468,7 +470,7 @@ var hn = {
var $wrapper = $(this).parent();
var $meta = $wrapper.find('span.comhead');
- $meta.append('<a class="toggle-replies">collapse<a>');
+ $meta.prepend('<a class="toggle-replies">[-]<a> ');
});
@@ -593,4 +595,4 @@ var hn = {
}
};
-$(hn.init);
+$(hn.init);

0 comments on commit 65364b1

Please sign in to comment.