123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156 |
- if (typeof window.RadControlsNamespace == "undefined")
- {
- window.RadControlsNamespace = {};
- }
- if (
- typeof(window.RadControlsNamespace.Screen) == "undefined" ||
- typeof(window.RadControlsNamespace.Screen.Version) == null ||
- window.RadControlsNamespace.Screen.Version < 1.1
- )
- {
- window.RadControlsNamespace.Screen =
- {
-
- Version : 1.1,
-
- GetViewPortSize : function()
- {
- var width = 0;
- var height = 0;
-
- var canvas = document.body;
- if (RadControlsNamespace.Browser.StandardsMode && !RadControlsNamespace.Browser.IsSafari)
- {
- canvas = document.documentElement;
- }
-
- if (RadControlsNamespace.Browser.IsMozilla && document.compatMode != "CSS1Compat")
- {
- canvas = document.body;
- }
-
- if (window.innerWidth)
- {
- width = window.innerWidth;
- height = window.innerHeight;
- }
- else
- {
- width = canvas.clientWidth;
- height = canvas.clientHeight;
- }
-
- width += canvas.scrollLeft;
- height += canvas.scrollTop;
-
- return { width : width - 6, height : height - 6 };
- },
-
- GetElementPosition : function (el)
- {
- var parent = null;
- var pos = {x: 0, y: 0};
- var box;
-
- if (el.getBoundingClientRect)
- {
- // IE
- box = el.getBoundingClientRect();
- var scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
- var scrollLeft = document.documentElement.scrollLeft || document.body.scrollLeft;
-
- pos.x = box.left + scrollLeft - 2;
- pos.y = box.top + scrollTop - 2;
-
- return pos;
- }
- else if (document.getBoxObjectFor)
- {
- // gecko
- try
- {
- box = document.getBoxObjectFor(el);
- pos.x = box.x - 2;
- pos.y = box.y - 2;
- }catch(e){}
- }
- else
- {
- // safari/opera
- pos.x = el.offsetLeft;
- pos.y = el.offsetTop;
- parent = el.offsetParent;
- if (parent != el)
- {
- while (parent)
- {
- pos.x += parent.offsetLeft;
- pos.y += parent.offsetTop;
- parent = parent.offsetParent;
- }
- }
- }
-
-
- if (window.opera)
- {
- parent = el.offsetParent;
-
- while (parent && parent.tagName.toLowerCase() != 'body' && parent.tagName.toLowerCase() != 'html')
- {
- pos.x -= parent.scrollLeft;
- pos.y -= parent.scrollTop;
- parent = parent.offsetParent;
- }
- }
- else
- {
- parent = el.parentNode;
- while (parent && parent.tagName.toLowerCase() != 'body' && parent.tagName.toLowerCase() != 'html')
- {
- pos.x -= parent.scrollLeft;
- pos.y -= parent.scrollTop;
-
- parent = parent.parentNode;
- }
- }
-
- return pos;
- },
-
- ElementOverflowsTop : function (element)
- {
- return this.GetElementPosition(element).y < 0;
- },
-
- ElementOverflowsLeft : function (element)
- {
- return this.GetElementPosition(element).x < 0;
- },
-
- ElementOverflowsBottom : function (screenSize, element)
- {
- var bottomEdge = this.GetElementPosition(element).y + RadControlsNamespace.Box.GetOuterHeight(element);
- return bottomEdge > screenSize.height;
- },
-
- ElementOverflowsRight : function (screenSize, element)
- {
- var rightEdge = this.GetElementPosition(element).x + RadControlsNamespace.Box.GetOuterWidth(element);
- return rightEdge > screenSize.width;
- }
- }
- }
- //BEGIN_ATLAS_NOTIFY
- if (typeof(Sys) != "undefined")
- {
- if (Sys.Application != null && Sys.Application.notifyScriptLoaded != null)
- {
- Sys.Application.notifyScriptLoaded();
- }
- }
- //END_ATLAS_NOTIFY
|