diff options
author | ctrlaltca@gmail.com <> | 2011-07-16 11:14:42 +0000 |
---|---|---|
committer | ctrlaltca@gmail.com <> | 2011-07-16 11:14:42 +0000 |
commit | 6b23858eea553ae0e33a7c26f35f4fb3204a37de (patch) | |
tree | 169d8d04bae345d825b0d9b8f8017c5b1b819bc7 /framework/Web/Javascripts/source | |
parent | fec18bb9251aa886f321b9697611c5c68ac52003 (diff) |
fix for #343 (reworked r2915 to be more backcompatible on clientside)
Diffstat (limited to 'framework/Web/Javascripts/source')
-rw-r--r-- | framework/Web/Javascripts/source/prado/controls/tabpanel.js | 40 |
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++;
}
}
};
|