From f342152fbec62e3e70a128d5a635516929b79601 Mon Sep 17 00:00:00 2001 From: huqi Date: Tue, 14 Jul 2020 11:08:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Ddialog=E4=BD=8D=E7=BD=AE?= =?UTF-8?q?=E5=9C=A8=E5=8F=AF=E8=A7=86=E5=8C=BA=E5=9F=9F=E5=86=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- o2web/source/o2_core/o2/widget/Dialog.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/o2web/source/o2_core/o2/widget/Dialog.js b/o2web/source/o2_core/o2/widget/Dialog.js index 658ca58b23..e33421488b 100644 --- a/o2web/source/o2_core/o2/widget/Dialog.js +++ b/o2web/source/o2_core/o2/widget/Dialog.js @@ -453,6 +453,20 @@ o2.widget.Dialog = o2.DL = new Class({ // // this.content.setStyle("display", "block"); // //this.fireEvent("postShow"); + var pn = this.node.getOffsetParent(); + var p = pn.getPosition(); + + var h = this.css.to.height.toInt(); + var y = this.css.to.top.toInt(); + y = y+p.y; + + var ih = window.innerHeight.toInt(); + if (h+y> ih){ + y = ih-p.y-h-20; + if (y<0) y=0; + this.css.to.top = ""+y+"px"; + } + this.morph.start(this.css.to).chain(function(){ if (this.titleText) this.getTitle(); if (this.button) this.getButton(); -- GitLab