Permalink
Browse files

added selectedTab to tabSet

  • Loading branch information...
1 parent f255df6 commit 4fd1f7caecacbabc1d10748083d7b632265ec197 @jcarrig jcarrig committed Jun 12, 2012
Showing with 11 additions and 2 deletions.
  1. +11 −2 src/js/tab_set.js
View
13 src/js/tab_set.js
@@ -4,7 +4,8 @@
// Tabs to initially add to this tab set. Each entry may contain
// a <code>label</code>, <code>content</code>, and <code>onActivate</code>
// option.
- tabs : []
+ tabs : [],
+ selectedTab : 0
},
initialize : function() {
@@ -26,7 +27,12 @@
this.addTab(this.options.alternatives[i]);
}
- this.activateTab(0);
+ if(this.options.selectedTab >= 0){
+ this.activateTab(this.options.selectedTab);
+ }
+ else{
+ $(this.el).addClass('no_selection');
+ }
return this;
},
@@ -59,6 +65,9 @@
},
activateTab : function(index) {
+
+ $(this.el).removeClass('no_selection');
+
// hide all content panels
_(this._contents).each(function(content) {
$(content).hide();

0 comments on commit 4fd1f7c

Please sign in to comment.