From bbc76fa4e1c80c492c729bba0408125eac66da05 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 10 Sep 2014 11:19:15 +0000 Subject: [PATCH] Make sure tab doesn't start by trying to display a hidden tab. --- etemplate/js/et2_widget_tabs.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/etemplate/js/et2_widget_tabs.js b/etemplate/js/et2_widget_tabs.js index f7fd2f6648..407fd8e342 100644 --- a/etemplate/js/et2_widget_tabs.js +++ b/etemplate/js/et2_widget_tabs.js @@ -78,7 +78,7 @@ var et2_tabbox = et2_valueWidget.extend([et2_IInput], _readTabs: function(tabData, tabs) { var selected = ""; - this.selected_index = 0; + this.selected_index = false; var hidden = {}; if (this.id) { @@ -131,6 +131,12 @@ var et2_tabbox = et2_valueWidget.extend([et2_IInput], } i++; }, this); + + // Make sure we don't try to display a hidden tab + for(var i = 0; i < tabData.length && this.selected_index === false; i++) + { + if(!tabData[i].hidden) this.selected_index = i; + } }, _readTabPanels: function(tabData, tabpanels) {