浏览代码

Fix Edit avatar UI issue.

Thanks to xet7 !

Fixes #5940
Lauri Ojansivu 1 周之前
父节点
当前提交
87ae085e6d
共有 2 个文件被更改,包括 22 次插入2 次删除
  1. 5 1
      client/components/main/popup.css
  2. 17 1
      client/lib/popup.js

+ 5 - 1
client/components/main/popup.css

@@ -158,7 +158,11 @@
   margin-left: 0;
 }
 .pop-over .content-container .content.no-height {
-  height: 2.5vh;
+  height: 0;
+  overflow: hidden;
+  padding: 0;
+  margin: 0;
+  visibility: hidden;
 }
 .pop-over .quiet {
 /*  padding: 6px 6px 4px;*/

+ 17 - 1
client/lib/popup.js

@@ -46,6 +46,8 @@ window.Popup = new (class {
           return;
         } else {
           $(previousOpenerElement).removeClass('is-active');
+          // Clean up previous popup content to prevent mixing
+          self._cleanupPreviousPopupContent();
         }
       }
 
@@ -58,7 +60,12 @@ window.Popup = new (class {
       if (clickFromPopup(evt) && self._getTopStack()) {
         openerElement = self._getTopStack().openerElement;
       } else {
-        self._stack = [];
+        // For Member Settings sub-popups, always start fresh to avoid content mixing
+        if (popupName.includes('changeLanguage') || popupName.includes('changeAvatar') || 
+            popupName.includes('editProfile') || popupName.includes('changePassword') ||
+            popupName.includes('invitePeople') || popupName.includes('support')) {
+          self._stack = [];
+        }
         openerElement = evt.currentTarget;
       }
       $(openerElement).addClass('is-active');
@@ -169,6 +176,8 @@ window.Popup = new (class {
       $(openerElement).removeClass('is-active');
 
       this._stack = [];
+      // Clean up popup content when closing
+      this._cleanupPreviousPopupContent();
     }
   }
 
@@ -182,6 +191,13 @@ window.Popup = new (class {
     return this._stack[this._stack.length - 1];
   }
 
+  _cleanupPreviousPopupContent() {
+    // Force a re-render to ensure proper cleanup
+    if (this._dep) {
+      this._dep.changed();
+    }
+  }
+
   // We automatically calculate the popup offset from the reference element
   // position and dimensions. We also reactively use the window dimensions to
   // ensure that the popup is always visible on the screen.