mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-24 14:27:58 -05:00
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:
@@ -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 */
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user