diff --git a/r2/r2/public/static/js/compact.js b/r2/r2/public/static/js/compact.js index 6ac5fb87e..c1cd5c8a4 100644 --- a/r2/r2/public/static/js/compact.js +++ b/r2/r2/public/static/js/compact.js @@ -92,12 +92,13 @@ $(function() { $(this).siblings(".save-button").toggle(); }); //Hide options when we collapse - $('.options_expando .collapse').live("click", function() { + $('.options_expando .collapse-button').live("click", function() { $(this).parent().removeClass('expanded'); + $(this).parent().parent().parent().addClass("collapsed"); $(this).parent().siblings('.options_link').removeClass("active"); }); - //Collapse when we click reply - $('.reply-button').live("click", function() { + //Collapse when we click reply, or edit + $('.reply-button, .edit-button').live("click", function() { $(this).parent().siblings('.options-link').click(); }); /* the iphone doesn't play nice with live() unless there is already a registered click function. That's sad */ diff --git a/r2/r2/templates/comment.compact b/r2/r2/templates/comment.compact index a8e9be232..0b0a38a7a 100644 --- a/r2/r2/templates/comment.compact +++ b/r2/r2/templates/comment.compact @@ -73,15 +73,15 @@ %if c.user_is_loggedin: ${icon_button("Reply", "reply-icon", onclick="return reply(this)", outer_class="reply-button")} %endif - ${icon_button("Collapse", "collapse-icon", onclick="return toggle_collapse(this)")} + ${icon_button("Collapse", "collapse-icon", outer_class="collapse-button")} ${icon_button("Permalink", "permalink-icon", thing.permalink + ".compact")} %if c.profilepage: ${icon_button("Context", "context-icon", thing.permalink + ".compact?context=3")} %elif thing.parent_permalink: - ${icon_button("Parent", "parent-icon", thing.parent_permalink )} + ${icon_button("Parent", "parent-icon", thing.parent_permalink + ".compact")} %endif %if thing.is_author: - ${icon_button("Edit", "edit-icon", onclick="return edit_usertext(this)")} + ${icon_button("Edit", "edit-icon", onclick="return edit_usertext(this)", outer_class="edit-button")} %endif