summaryrefslogtreecommitdiffstats
path: root/schemas/OMNA Schema-based Namespace Registry_fichiers/Box.js
blob: fbd63dc7ac30d9afe8c8ebee43b1439eb98e09da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
if (typeof window.RadControlsNamespace == "undefined")
{
	window.RadControlsNamespace = {};
}

if (
	typeof(window.RadControlsNamespace.Box) == "undefined" ||
	typeof(window.RadControlsNamespace.Box.Version) == null ||
	window.RadControlsNamespace.Box.Version < 2
	)
{

	window.RadControlsNamespace.Box = 
	{
		Version : 2, /// Change the version when make changes. Change the value in the IF also
		
		GetOuterWidth : function (element)
		{
			return element.offsetWidth;
		},
		
		GetOuterHeight : function (element)
		{
			return element.offsetHeight;	
		},	
		
		SetOuterHeight : function (element, height)
		{
			if (height <= 0 || height == "") 
			{
				element.style.height = "";
			} 
			else
			{
				element.style.height = height + "px";
				var diff = element.offsetHeight - height;
				var newHeight = height - diff;
				if (newHeight > 0) {
					element.style.height = newHeight + "px";
				} else {
					element.style.height = "";
				}
			}
		},
		
		SetOuterWidth : function (element, width)
		{
	
			if (width <= 0 || width == "") 
			{
				element.style.width = "";
			}
			else
			{
				element.style.width = width + "px";
				var diff = element.offsetWidth - width;
				var newWidth = width - diff;
				if (newWidth > 0) {
					element.style.width = newWidth + "px";
				} else {
					element.style.width = "";
				}
				return newWidth;
			}
		},
		
	
		GetPropertyValue : function(element, styleProperty)
		{
	        var computedStyle = this.GetStyle(element);
	        return this.GetStyleValues(computedStyle, styleProperty);	
		},
		
		
		GetStyle : function (element)
		{
			if (document.defaultView && document.defaultView.getComputedStyle)
			{
				return document.defaultView.getComputedStyle(element, null);
			}
			else if (element.currentStyle)
			{
				return element.currentStyle;
			}
			else
			{
				return element.style;
			}
		}
	}
}

//BEGIN_ATLAS_NOTIFY
if (typeof(Sys) != "undefined")
{
	if (Sys.Application != null && Sys.Application.notifyScriptLoaded != null)
	{
		Sys.Application.notifyScriptLoaded();
	}
}
//END_ATLAS_NOTIFY
OpenPOWER on IntegriCloud