modify relationship preview js
This commit is contained in:
@@ -140,32 +140,30 @@
|
||||
var current_post_id = $("meta[name=post-id]").attr("content");
|
||||
$("#post_" + current_post_id).css("background-color", "rgba(0,0,0,0.05)");
|
||||
|
||||
$("#has-children-relationship-preview").hide();
|
||||
$("#has-parent-relationship-preview").hide();
|
||||
this.toggle_relationship_preview($("#has-children-relationship-preview"), $("#has-children-relationship-preview-link"));
|
||||
this.toggle_relationship_preview($("#has-parent-relationship-preview"), $("#has-parent-relationship-preview-link"));
|
||||
|
||||
$("#has-children-relationship-preview-link").click(function(e) {
|
||||
$("#has-children-relationship-preview").toggle();
|
||||
if ($("#has-children-relationship-preview").is(":visible")) {
|
||||
$(this).html("« hide");
|
||||
}
|
||||
else {
|
||||
$(this).html("show »");
|
||||
}
|
||||
Danbooru.Post.toggle_relationship_preview($("#has-children-relationship-preview"), $(this));
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
$("#has-parent-relationship-preview-link").click(function(e) {
|
||||
$("#has-parent-relationship-preview").toggle();
|
||||
if ($("#has-parent-relationship-preview").is(":visible")) {
|
||||
$(this).html("« hide");
|
||||
}
|
||||
else {
|
||||
$(this).html("show »");
|
||||
}
|
||||
Danbooru.Post.toggle_relationship_preview($("#has-parent-relationship-preview"), $(this));
|
||||
e.preventDefault();
|
||||
});
|
||||
}
|
||||
|
||||
Danbooru.Post.toggle_relationship_preview = function(preview, preview_link) {
|
||||
preview.toggle();
|
||||
if (preview.is(":visible")) {
|
||||
preview_link.html("« hide");
|
||||
}
|
||||
else {
|
||||
preview_link.html("show »");
|
||||
}
|
||||
}
|
||||
|
||||
Danbooru.Post.initialize_favlist = function() {
|
||||
$("#favlist").hide();
|
||||
$("#hide-favlist-link").hide();
|
||||
|
||||
@@ -56,7 +56,7 @@ module PostsHelper
|
||||
|
||||
html << " (#{link_to("learn more", wiki_pages_path(:title => "help:post_relationships"))}) "
|
||||
|
||||
html << link_to("show »".html_safe, "#", :id => "has-parent-relationship-preview-link")
|
||||
html << link_to("« hide".html_safe, "#", :id => "has-parent-relationship-preview-link")
|
||||
|
||||
html.html_safe
|
||||
end
|
||||
@@ -70,7 +70,7 @@ module PostsHelper
|
||||
|
||||
html << " (#{link_to("learn more", wiki_pages_path(:title => "help:post_relationships"))}) "
|
||||
|
||||
html << link_to("show »".html_safe, "#", :id => "has-children-relationship-preview-link")
|
||||
html << link_to("« hide".html_safe, "#", :id => "has-children-relationship-preview-link")
|
||||
|
||||
html.html_safe
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user