Browse Source

Merge branch 'dev_220318_test' into test

wenliming 3 năm trước cách đây
mục cha
commit
509dc8afc4
2 tập tin đã thay đổi với 10 bổ sung11 xóa
  1. 5 6
      src/logic/twitter.js
  2. 5 5
      src/view/components/follow-input.vue

+ 5 - 6
src/logic/twitter.js

@@ -363,16 +363,15 @@ function _deNetBtnClick(port) {
  */
 let isSetContent = false;
 function _setPublishContent(content) {
-    setTimeout(() => {
-        if (!isSetContent) {
-            isSetContent = true;
+    if (!isSetContent) {
+        isSetContent = true;
+        setTimeout(() => {
             document.execCommand("insertText", false, content);
             setTimeout(() => {
                 isSetContent = false;
             }, 2000)
-        }
-
-    }, 1000);
+        }, 1000);
+    }
 }
 
 /**

+ 5 - 5
src/view/components/follow-input.vue

@@ -18,8 +18,7 @@
                     @mouseenter="iptMouseenter"/>
 
             <template v-if="currentIptIndex == index && userList.length">
-                <div class="user-list-wrapper"
-                    :style="{ left: domStyle.left + 'px', top: domStyle.top + 'px' }">
+                <div class="user-list-wrapper">
                     <div class="item" 
                         v-for="(item, index) in userList"
                         :key="index"
@@ -210,9 +209,10 @@ const iptMouseenter = (e) => {
 const rectClick = (event) => {
     //获取相对于当前所指向对象的位置坐标
     console.log(event,'x:' + event.clientX + "  y:" +  event.clientY);
+    let dom = event.target;
     domStyle.value = {
-        left : event.clientX / 2,
-        top: event.clientY
+        left : (dom.getBoundingClientRect().left / 2) - 140,
+        top: dom.getBoundingClientRect().top + 20
     }
 }
 
@@ -302,7 +302,7 @@ const onUserMouseLeave = (params, index) => {
             .user-list-wrapper {
                 width: 284px;
                 max-height: 430px;
-                position: fixed;
+                position: absolute;
                 box-shadow: 0px 4px 20px 0px #0000004D;
                 overflow-y: scroll;
                 background-color: #fff;