From a2186c19dccebaaf5e90328a4198cad464b72eef Mon Sep 17 00:00:00 2001 From: evazion Date: Thu, 25 Oct 2018 22:39:29 -0500 Subject: [PATCH] Fix positioning of tag edit dialog box. Bug: if you open the tag edit dialog with shift+e, close it, then open it again, it won't be vertically centered when it opens the second time. Fix: hide the related tags section *before* opening the dialog, not after. Hiding it afterwards shifts the layout, which uncenters the dialog. --- app/javascript/src/javascripts/posts.js.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/javascript/src/javascripts/posts.js.erb b/app/javascript/src/javascripts/posts.js.erb index 9273263d0..282a4ef22 100644 --- a/app/javascript/src/javascripts/posts.js.erb +++ b/app/javascript/src/javascripts/posts.js.erb @@ -89,6 +89,8 @@ Post.open_edit_dialog = function() { return; } + $(document).trigger("danbooru:open-post-edit-dialog"); + $("#edit").show(); $("#comments").hide(); $("#post-sections li").removeClass("active"); @@ -149,8 +151,6 @@ Post.open_edit_dialog = function() { $tag_string.css({"resize": "none", "width": "100%"}); $tag_string.focus().selectEnd().height($tag_string[0].scrollHeight); - - $(document).trigger("danbooru:open-post-edit-dialog"); } Post.close_edit_dialog = function(e, ui) {