summaryrefslogtreecommitdiff
path: root/framework/Web/Javascripts
diff options
context:
space:
mode:
authorctrlaltca@gmail.com <>2011-07-16 11:19:23 +0000
committerctrlaltca@gmail.com <>2011-07-16 11:19:23 +0000
commit5cb73482195692d9a231873543571f959fce17f8 (patch)
tree5cbc347c3c28778fd14a694b30b36a0a3391dcc3 /framework/Web/Javascripts
parent06c77e286dd77bcbc8c81d8f7c6f158f6fa2ca34 (diff)
backported r3012 to branch/3.1
Diffstat (limited to 'framework/Web/Javascripts')
-rw-r--r--framework/Web/Javascripts/source/prado/controls/tabpanel.js40
1 files changed, 20 insertions, 20 deletions
diff --git a/framework/Web/Javascripts/source/prado/controls/tabpanel.js b/framework/Web/Javascripts/source/prado/controls/tabpanel.js
index 363b5271..f613a677 100644
--- a/framework/Web/Javascripts/source/prado/controls/tabpanel.js
+++ b/framework/Web/Javascripts/source/prado/controls/tabpanel.js
@@ -11,54 +11,54 @@ Prado.WebUI.TTabPanel.prototype =
onInit : function(options)
{
this.views = options.Views;
+ this.viewsvis = options.ViewsVis;
this.hiddenField = $(options.ID+'_1');
this.activeCssClass = options.ActiveCssClass;
this.normalCssClass = options.NormalCssClass;
- var i = 0;
- for(var index in options.Views)
+ var length = options.Views.length;
+ for(var i = 0; i<length; i++)
{
- var element = $(index+'_0');
- if (options.Views[index])
+ var item = options.Views[i];
+ var element = $(item+'_0');
+ if (options.ViewsVis[i])
{
- Event.observe(element, "click", this.elementClicked.bindEvent(this,index));
+ Event.observe(element, "click", this.elementClicked.bindEvent(this,item));
}
+
if(element)
{
if(this.hiddenField.value == i)
{
element.className=this.activeCssClass;
- $(index).show();
- }
- else
- {
+ $(options.Views[i]).show();
+ } else {
element.className=this.normalCssClass;
- $(index).hide();
+ $(options.Views[i]).hide();
}
}
- i++;
}
},
elementClicked : function(event,viewID)
{
- var i = 0;
- for(var index in this.views)
+ var length = this.views.length;
+ for(var i = 0; i<length; i++)
{
- if ($(index))
+ var item = this.views[i];
+ if ($(item))
{
- if(index == viewID)
+ if(item == viewID)
{
- $(index+'_0').className=this.activeCssClass;
- $(index).show();
+ $(item+'_0').className=this.activeCssClass;
+ $(item).show();
this.hiddenField.value=i;
}
else
{
- $(index+'_0').className=this.normalCssClass;
- $(index).hide();
+ $(item+'_0').className=this.normalCssClass;
+ $(item).hide();
}
}
- i++;
}
}
};