Commit add698e6 authored by 胡起's avatar 胡起
Browse files

Merge branch 'cherry-pick-a077aede' into 'master'

Merge branch 'fix/dig_position' into 'develop' 修复dialog位置在可视区域内

See merge request o2oa/o2oa!1123
parents 11424f81 efeec8bf
Showing with 14 additions and 0 deletions
+14 -0
......@@ -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();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment