Przeglądaj źródła

修复移动端dialog偏移的bug

fancy 5 lat temu
rodzic
commit
e24845b249

+ 4 - 2
o2web/source/x_component_Common/Main.js

@@ -560,6 +560,8 @@ MWF.xApplication.Common.Main = new Class({
 					y = y - parseFloat(height);
 				}
 				if (y < 0) y = 0;
+				// 鼠标位置往左偏移
+				x = x - 20;
 			}
 
 
@@ -582,9 +584,9 @@ MWF.xApplication.Common.Main = new Class({
 				"title": title,
 				"style": style || "o2",
 				"top": y,
-				"left": x - 20,
+				"left": x,
 				"fromTop": y,
-				"fromLeft": x - 20,
+				"fromLeft": x,
 				"width": width,
 				"height": height,
 				"text": ctext,

+ 4 - 1
o2web/source/x_component_process_Xform/Form.js

@@ -2384,11 +2384,14 @@ MWF.xApplication.process.Xform.Form = MWF.APPForm = new Class(
             //     x = x-parseFloat(width);
             // }
             if (x < 0) x = 20;
+            if (!layout.mobile) { // pc上鼠标位置偏移20
+                x = x - 20
+            }
             var dlg = new MWF.xDesktop.Dialog({
                 "title": title,
                 "style": style || "o2",
                 "top": y,
-                "left": x - 20,
+                "left": x,
                 "fromTop": e.event.y,
                 "fromLeft": (Browser.name === "firefox") ? e.event.clientX - 20 : e.event.x - 20,
                 "width": width,