浏览代码

审批定位到审批人位置

laiguoran 5 年之前
父节点
当前提交
ddcc029193
共有 1 个文件被更改,包括 5 次插入3 次删除
  1. 5 3
      app/view/stage/audit_modal.ejs

+ 5 - 3
app/view/stage/audit_modal.ejs

@@ -1593,12 +1593,10 @@
         // $('#hide-all').hide();
         // $('#hide-all').hide();
         // return false;
         // return false;
     });
     });
-    
+
     // 定位到审批框高度
     // 定位到审批框高度
     $('.modal').on('shown.bs.modal', function () {
     $('.modal').on('shown.bs.modal', function () {
         const height = $(this)[0].scrollHeight;
         const height = $(this)[0].scrollHeight;
-        const hdiv = divSearch($(this).find('textarea')) ? $(this).find('textarea') : null;
-        const hdheight = hdiv ? hdiv.parents('.list-group-item').offset().top : null;
         const scrollBox = $(this).find('div[class="col-8 modal-height-500"]');
         const scrollBox = $(this).find('div[class="col-8 modal-height-500"]');
         const bdiv = scrollBox.offset().top;
         const bdiv = scrollBox.offset().top;
 
 
@@ -1606,6 +1604,10 @@
         // if (scrollBox.length && scrollBox[0].scrollHeight > 450) {
         // if (scrollBox.length && scrollBox[0].scrollHeight > 450) {
         //     scrollBox.scrollTop(height);
         //     scrollBox.scrollTop(height);
         // }
         // }
+        scrollBox.scrollTop(0);
+        const hdiv = divSearch($(this).find('textarea')) ? $(this).find('textarea') : null;
+        const hdheight = hdiv ? hdiv.parents('.list-group-item').offset().top : null;
+        console.log(hdheight);
         if (hdiv && scrollBox.length &&  scrollBox[0].scrollHeight > 450 && hdheight - bdiv > 450) {
         if (hdiv && scrollBox.length &&  scrollBox[0].scrollHeight > 450 && hdheight - bdiv > 450) {
             scrollBox.scrollTop(hdheight - bdiv);
             scrollBox.scrollTop(hdheight - bdiv);
         }
         }