Files
SIG/Scripts/AjaxControlToolkit/Release/HtmlEditor.Popups.AttachedPopup.js
rrene 927295c7ba Revert "-- corr"
This reverts commit 5315c47fcd.
2024-11-05 10:55:34 -07:00

1 line
1.8 KiB
JavaScript

Type.registerNamespace("Sys.Extended.UI.HtmlEditor.Popups");Sys.Extended.UI.HtmlEditor.Popups.AttachedPopup=function(n){Sys.Extended.UI.HtmlEditor.Popups.AttachedPopup.initializeBase(this,[n]);this._relatedElement=null};Sys.Extended.UI.HtmlEditor.Popups.AttachedPopup.prototype={get_relatedElement:function(){return this._relatedElement},set_relatedElement:function(n){this._relatedElement=n},open:function(n){var h,f,e,o,s;if(this._relatedElement!=null){if(h=this,!this.checkCorrectLoaded(function(){h.open(n)}))return;for(var c=$common.getLocation(this._relatedElement),i=c.x,r=c.y+this._relatedElement.offsetHeight,t=this.get_element().parentNode;t&&t.tagName&&t.tagName.toUpperCase()!="BODY";){if(f=Sys.Extended.UI.HtmlEditor.getStyle(t,"position"),f=="absolute"||f=="fixed"){e=parseInt(Sys.Extended.UI.HtmlEditor.getStyle(t,"top"));o=parseInt(Sys.Extended.UI.HtmlEditor.getStyle(t,"left"));isNaN(e)||isNaN(o)||(i-=o,r-=e);break}else f=="relative"&&(s=$common.getLocation(t),i-=s.x,r-=s.y);t=t.parentNode}var u=Sys.Extended.UI.HtmlEditor.getClientViewportElement(this._iframe),l=u.clientWidth+u.scrollLeft,a=u.clientHeight+u.scrollTop;r<u.scrollTop&&(r=u.scrollTop);i<u.scrollLeft&&(i=u.scrollLeft);r+this._iframe.offsetHeight>a&&(r-=r+this._iframe.offsetHeight-a);i+this._iframe.offsetWidth>l&&(i-=i+this._iframe.offsetWidth-l);Sys.Extended.UI.HtmlEditor.Popups.AttachedPopup.callBaseMethod(this,"open",[n,r,i])}},close:function(n){Sys.Extended.UI.HtmlEditor.Popups.AttachedPopup.callBaseMethod(this,"close",[n])},initialize:function(){Sys.Extended.UI.HtmlEditor.Popups.AttachedPopup.callBaseMethod(this,"initialize")},dispose:function(){Sys.Extended.UI.HtmlEditor.Popups.AttachedPopup.callBaseMethod(this,"dispose")}};Sys.Extended.UI.HtmlEditor.Popups.AttachedPopup.registerClass("Sys.Extended.UI.HtmlEditor.Popups.AttachedPopup",Sys.Extended.UI.HtmlEditor.Popups.Popup);