forum: add "..." menu to forum posts, like comments have.

Adds the ability to copy forum post IDs, like with comments.

Fixes #4768: Display DText shortlink for forum posts/topics.
This commit is contained in:
evazion
2022-01-13 12:45:01 -06:00
parent 4cb01d5813
commit 5adeedcf01
6 changed files with 100 additions and 54 deletions

View File

@@ -1,33 +0,0 @@
let ForumPost = {};
ForumPost.initialize_all = function() {
if ($("#c-forum-topics #a-show,#c-forum-posts #a-show").length) {
this.initialize_edit_links();
}
}
ForumPost.initialize_edit_links = function() {
$(document).on("click.danbooru", ".edit_forum_post_link", function(e) {
let $form = $(this).parents("article.forum-post").find("form.edit_forum_post");
$form.fadeToggle("fast");
e.preventDefault();
});
$(document).on("click.danbooru", ".edit_forum_topic_link", function(e) {
let $form = $(this).parents("article.forum-post").find("form.edit_forum_topic");
$form.fadeToggle("fast");
e.preventDefault();
});
$(document).on("click.danbooru", "#c-forum-topics #a-show #new-response-link", function (e) {
$("#topic-response").show();
document.body.scrollIntoView(false);
e.preventDefault();
});
}
$(document).ready(function() {
ForumPost.initialize_all();
});
export default ForumPost