fixes #115: add option for toggling edit on post/show

This commit is contained in:
albert
2011-10-14 15:20:26 -04:00
parent 615796fd24
commit b20f5ac368
3 changed files with 8 additions and 1 deletions

View File

@@ -9,6 +9,12 @@
this.initialize_post_image_resize_links();
this.initialize_image_resize();
this.initialize_titles();
$("#side-edit-link").click(function(e) {
$("#post-edit-link").trigger("click");
$("#post_tag_string").trigger("focus");
e.preventDefault();
});
}
Danbooru.Post.initialize_titles = function() {

View File

@@ -1,5 +1,6 @@
<ul>
<%= resize_image_links(post, CurrentUser.user) %>
<li><%= link_to "Edit", post_path(post), :id => "side-edit-link" %></li>
<% if CurrentUser.is_member? %>
<li><%= link_to "Favorite", favorites_path(:post_id => post.id), :remote => true, :method => :post, :id => "add-to-favorites" %></li>
<li><%= link_to "Unfavorite", favorite_path(post), :remote => true, :method => :delete, :id => "remove-from-favorites" %></li>

View File

@@ -45,7 +45,7 @@
<menu id="post-sections">
<li><a href="#comments">Comments</a></li>
<li><a href="#edit">Edit</a></li>
<li><a href="#edit" id="post-edit-link">Edit</a></li>
<li><a href="#notes">Notes</a></li>
</menu>