]> git.wh0rd.org - tt-rss.git/blobdiff - lib/dijit/layout/TabContainer.js
upgrade Dojo to 1.6.1
[tt-rss.git] / lib / dijit / layout / TabContainer.js
index d765cf7e47fbc5133580164976ee52d2d069029d..00942246442983cda7d13f935ff5f1556589b33a 100644 (file)
@@ -1,23 +1,76 @@
 /*
-       Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved.
+       Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
        Available via Academic Free License >= 2.1 OR the modified BSD license.
        see: http://dojotoolkit.org/license for details
 */
 
 
-if(!dojo._hasResource["dijit.layout.TabContainer"]){
-dojo._hasResource["dijit.layout.TabContainer"]=true;
+if(!dojo._hasResource["dijit.layout.TabContainer"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dijit.layout.TabContainer"] = true;
 dojo.provide("dijit.layout.TabContainer");
 dojo.require("dijit.layout._TabContainerBase");
 dojo.require("dijit.layout.TabController");
 dojo.require("dijit.layout.ScrollingTabController");
-dojo.declare("dijit.layout.TabContainer",dijit.layout._TabContainerBase,{useMenu:true,useSlider:true,controllerWidget:"",_makeController:function(_1){
-var _2=this.baseClass+"-tabs"+(this.doLayout?"":" dijitTabNoLayout"),_3=dojo.getObject(this.controllerWidget);
-return new _3({id:this.id+"_tablist",dir:this.dir,lang:this.lang,tabPosition:this.tabPosition,doLayout:this.doLayout,containerId:this.id,"class":_2,nested:this.nested,useMenu:this.useMenu,useSlider:this.useSlider,tabStripClass:this.tabStrip?this.baseClass+(this.tabStrip?"":"No")+"Strip":null},_1);
-},postMixInProperties:function(){
-this.inherited(arguments);
-if(!this.controllerWidget){
-this.controllerWidget=(this.tabPosition=="top"||this.tabPosition=="bottom")&&!this.nested?"dijit.layout.ScrollingTabController":"dijit.layout.TabController";
-}
-}});
+
+
+dojo.declare("dijit.layout.TabContainer",
+       dijit.layout._TabContainerBase,
+       {
+               // summary:
+               //              A Container with tabs to select each child (only one of which is displayed at a time).
+               // description:
+               //              A TabContainer is a container that has multiple panes, but shows only
+               //              one pane at a time.  There are a set of tabs corresponding to each pane,
+               //              where each tab has the name (aka title) of the pane, and optionally a close button.
+
+               // useMenu: [const] Boolean
+               //              True if a menu should be used to select tabs when they are too
+               //              wide to fit the TabContainer, false otherwise.
+               useMenu: true,
+
+               // useSlider: [const] Boolean
+               //              True if a slider should be used to select tabs when they are too
+               //              wide to fit the TabContainer, false otherwise.
+               useSlider: true,
+
+               // controllerWidget: String
+               //              An optional parameter to override the widget used to display the tab labels
+               controllerWidget: "",
+
+               _makeController: function(/*DomNode*/ srcNode){
+                       // summary:
+                       //              Instantiate tablist controller widget and return reference to it.
+                       //              Callback from _TabContainerBase.postCreate().
+                       // tags:
+                       //              protected extension
+
+                       var cls = this.baseClass + "-tabs" + (this.doLayout ? "" : " dijitTabNoLayout"),
+                               TabController = dojo.getObject(this.controllerWidget);
+
+                       return new TabController({
+                               id: this.id + "_tablist",
+                               dir: this.dir,
+                               lang: this.lang,
+                               tabPosition: this.tabPosition,
+                               doLayout: this.doLayout,
+                               containerId: this.id,
+                               "class": cls,
+                               nested: this.nested,
+                               useMenu: this.useMenu,
+                               useSlider: this.useSlider,
+                               tabStripClass: this.tabStrip ? this.baseClass + (this.tabStrip ? "":"No") + "Strip": null
+                       }, srcNode);
+               },
+
+               postMixInProperties: function(){
+                       this.inherited(arguments);
+
+                       // Scrolling controller only works for horizontal non-nested tabs
+                       if(!this.controllerWidget){
+                               this.controllerWidget = (this.tabPosition == "top" || this.tabPosition == "bottom") && !this.nested ?
+                                                       "dijit.layout.ScrollingTabController" : "dijit.layout.TabController";
+                       }
+               }
+});
+
 }