fixes #115: add option for toggling edit on post/show
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user