blob: 866e45fb2a36c2b31c991f02bba8fa5dc59a00d1 (
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
|
Prado.WebUI.TTabPanel = jQuery.klass(Prado.WebUI.Control,
{
onInit : function(options)
{
this.views = options.Views;
this.viewsvis = options.ViewsVis;
this.hiddenField = jQuery("#"+options.ID+'_1').get(0);
this.activeCssClass = options.ActiveCssClass;
this.normalCssClass = options.NormalCssClass;
var length = options.Views.length;
for(var i = 0; i<length; i++)
{
var item = options.Views[i];
var element = jQuery("#"+item+'_0').get(0);
if (element && options.ViewsVis[i])
{
this.observe(element, "click", jQuery.proxy(this.elementClicked,this,item));
if (options.AutoSwitch)
this.observe(element, "mouseenter", jQuery.proxy(this.elementClicked,this,item));
}
if(element)
{
var view = jQuery("#"+options.Views[i]).get(0);
if (view)
if(this.hiddenField.value == i)
{
element.className=this.activeCssClass;
jQuery(view).show();
} else {
element.className=this.normalCssClass;
jQuery(view).hide();
}
}
}
},
elementClicked : function(viewID, event)
{
var length = this.views.length;
for(var i = 0; i<length; i++)
{
var item = this.views[i];
if (jQuery("#"+item))
{
if(item == viewID)
{
jQuery("#"+item+'_0').removeClass(this.normalCssClass).addClass(this.activeCssClass);
jQuery("#"+item).show();
this.hiddenField.value=i;
}
else
{
jQuery("#"+item+'_0').removeClass(this.activeCssClass).addClass(this.normalCssClass);
jQuery("#"+item).hide();
}
}
}
}
});
|