소스 검색

修改弹窗位置

zhangxc 6 년 전
부모
커밋
f348c42463
1개의 변경된 파일4개의 추가작업 그리고 3개의 파일을 삭제
  1. 4 3
      src/js/promise.js

+ 4 - 3
src/js/promise.js

@@ -56,13 +56,14 @@ const post = function(url,data){
 const newinConf = {
   width: '600',   //窗口的文档显示区的宽度。以像素计。
   height: '600',  //窗口文档显示区的高度。以像素计。
-  left: '300',  //窗口的 x 坐标。以像素计。
-  top: '300'    //窗口的 y 坐标。以像素计。
+  left: '0',  //窗口的 x 坐标。以像素计。
+  top: '0',    //窗口的 y 坐标。以像素计。
+  openMode: "newWin"  //每次都是新窗口打开为_blank,打开同一窗口填写任意字符串
 }
 
 const newWindowLocation = `width=${newinConf.width}, height=${newinConf.height}, left=${newinConf.left}, top=${newinConf.top} scrollbars=yes`
 const openNewWin = function(url) {
-  window.open(url, "newwindow", newWindowLocation)
+  window.open(url, newinConf.openMode, newWindowLocation)
 }
 
 const throttle =  function(fn, threshhold) {