]>
git.wh0rd.org - tt-rss.git/blob - lib/dijit/layout/TabContainer.js
2 Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
3 Available via Academic Free License >= 2.1 OR the modified BSD license.
4 see: http://dojotoolkit.org/license for details
8 if(!dojo
._hasResource
["dijit.layout.TabContainer"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
9 dojo
._hasResource
["dijit.layout.TabContainer"] = true;
10 dojo
.provide("dijit.layout.TabContainer");
11 dojo
.require("dijit.layout._TabContainerBase");
12 dojo
.require("dijit.layout.TabController");
13 dojo
.require("dijit.layout.ScrollingTabController");
16 dojo
.declare("dijit.layout.TabContainer",
17 dijit
.layout
._TabContainerBase
,
20 // A Container with tabs to select each child (only one of which is displayed at a time).
22 // A TabContainer is a container that has multiple panes, but shows only
23 // one pane at a time. There are a set of tabs corresponding to each pane,
24 // where each tab has the name (aka title) of the pane, and optionally a close button.
26 // useMenu: [const] Boolean
27 // True if a menu should be used to select tabs when they are too
28 // wide to fit the TabContainer, false otherwise.
31 // useSlider: [const] Boolean
32 // True if a slider should be used to select tabs when they are too
33 // wide to fit the TabContainer, false otherwise.
36 // controllerWidget: String
37 // An optional parameter to override the widget used to display the tab labels
40 _makeController: function(/*DomNode*/ srcNode
){
42 // Instantiate tablist controller widget and return reference to it.
43 // Callback from _TabContainerBase.postCreate().
45 // protected extension
47 var cls
= this.baseClass
+ "-tabs" + (this.doLayout
? "" : " dijitTabNoLayout"),
48 TabController
= dojo
.getObject(this.controllerWidget
);
50 return new TabController({
51 id
: this.id
+ "_tablist",
54 tabPosition
: this.tabPosition
,
55 doLayout
: this.doLayout
,
59 useMenu
: this.useMenu
,
60 useSlider
: this.useSlider
,
61 tabStripClass
: this.tabStrip
? this.baseClass
+ (this.tabStrip
? "":"No") + "Strip": null
65 postMixInProperties: function(){
66 this.inherited(arguments
);
68 // Scrolling controller only works for horizontal non-nested tabs
69 if(!this.controllerWidget
){
70 this.controllerWidget
= (this.tabPosition
== "top" || this.tabPosition
== "bottom") && !this.nested
?
71 "dijit.layout.ScrollingTabController" : "dijit.layout.TabController";