UX: Position topic admin menu next to wrench (#9932)

UX: Position topic admin menu next to wrench (#9932)

diff --git a/app/assets/javascripts/discourse/app/widgets/topic-admin-menu.js b/app/assets/javascripts/discourse/app/widgets/topic-admin-menu.js
index 4d0ea65..2ba85da 100644
--- a/app/assets/javascripts/discourse/app/widgets/topic-admin-menu.js
+++ b/app/assets/javascripts/discourse/app/widgets/topic-admin-menu.js
@@ -90,19 +90,31 @@ createWidget("topic-admin-menu-button", {
       $button = $(e.target).closest("button");
     }
 
-    const position = $button.position();
+    const position = $button.position(),
+      SPACING = 3,
+      MENU_WIDTH = 217;
 
     const rtl = $("html").hasClass("rtl");
     position.outerHeight = $button.outerHeight();
 
     if (rtl) {
-      position.left -= 217 - $button.outerWidth();
+      position.left -= MENU_WIDTH - $button.outerWidth();
     }
 
     if (this.attrs.fixed) {
       position.left += $button.width() - 203;
     }
 
+    if (this.attrs.openUpwards) {
+      if (rtl) {
+        position.left -= $button[0].offsetWidth + SPACING;
+      } else {
+        position.left += $button[0].offsetWidth + SPACING;
+      }
+    } else {
+      position.top += $button[0].offsetHeight + SPACING;
+    }
+
     if (this.site.mobileView && !this.attrs.rightSide) {
       const headerCloak = document.querySelector(".header-cloak");
       if (headerCloak) headerCloak.style.display = "block";

GitHub sha: f2647f1f

This commit appears in #9932 which was merged by pmusaraj.