Fixed last permalink bug, and added new javascript for collapse.

Also added JS to collapse when reply or edit are opened.
This commit is contained in:
Paradox
2011-08-10 12:11:46 -07:00
committed by Max Goodman
parent 416676c431
commit 40ff9aa3d4
2 changed files with 7 additions and 6 deletions

View File

@@ -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 */

View File

@@ -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
</div>
</div>